Skip to content

Commit

Permalink
Merge pull request #121 from datadrivers/chore/pre-commit-setup
Browse files Browse the repository at this point in the history
chore: install pre-commit and run it for all files
  • Loading branch information
fabrue committed Aug 14, 2023
2 parents 7c58872 + 9f28310 commit 02aebbe
Show file tree
Hide file tree
Showing 10 changed files with 31 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1 @@
scripts/license.lic
scripts/license.lic
20 changes: 20 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.3.0
hooks:
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/commitizen-tools/commitizen
rev: v2.27.1
hooks:
- id: commitizen
stages: [commit-msg]
- repo: https://github.com/tekwizely/pre-commit-golang
rev: v1.0.0-rc.1
hooks:
- id: go-fmt
- id: go-mod-tidy
- id: go-imports
# FIX ME: See https://github.com/datadrivers/go-nexus-client/issues/122
# - id: go-vet
# - id: golangci-lint-mod
2 changes: 1 addition & 1 deletion nexus3/pkg/repository/bower/proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
)

const (
bowerProxyAPIEndpoint = repositoryBowerAPIEndpoint + "/proxy"
bowerProxyAPIEndpoint = repositoryBowerAPIEndpoint + "/proxy"
)

type RepositoryBowerProxyService struct {
Expand Down
1 change: 1 addition & 0 deletions nexus3/pkg/repository/bower/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
const (
repositoryBowerAPIEndpoint = common.RepositoryAPIEndpoint + "/bower"
)

type RepositoryBowerService struct {
client *client.Client

Expand Down
2 changes: 1 addition & 1 deletion nexus3/pkg/repository/maven/proxy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ func getTestMavenProxyRepository(name string) repository.MavenProxyRepository {
Proxy: repository.Proxy{
ContentMaxAge: 1440,
MetadataMaxAge: 1440,
RemoteURL: "https://archive.ubuntu.com/ubuntu/",
RemoteURL: "https://archive.ubuntu.com/ubuntu/",
},
Storage: repository.Storage{
BlobStoreName: "default",
Expand Down
1 change: 0 additions & 1 deletion nexus3/pkg/repository/npm/group_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ func TestNpmGroupRepository(t *testing.T) {
repo.Group.MemberNames = append(repo.Group.MemberNames, testProxyRepo.Name)
}


err = service.Group.Create(repo)
assert.Nil(t, err)
generatedRepo, err := service.Group.Get(repo.Name)
Expand Down
2 changes: 1 addition & 1 deletion nexus3/pkg/security/testfiles/saml-testconfig.xml
Original file line number Diff line number Diff line change
Expand Up @@ -119,4 +119,4 @@ facing addresses if this IdP is hosted behind a reverse proxy. -->

</IDPSSODescriptor>

</EntityDescriptor>
</EntityDescriptor>
2 changes: 1 addition & 1 deletion nexus3/schema/repository/bower.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ type BowerProxyRepository struct {
RoutingRuleName *string `json:"routingRuleName,omitempty"`

*Cleanup `json:"cleanup,omitempty"`
Bower `json:"bower"`
Bower `json:"bower"`
}

type Bower struct {
Expand Down
8 changes: 4 additions & 4 deletions nexus3/schema/repository/http_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,11 @@ type HTTPClientAuthentication struct {

// HTTPClientAuthenticationWithPreemptive ...
type HTTPClientAuthenticationWithPreemptive struct {
NTLMDomain string `json:"ntlmDomain,omitempty"`
NTLMHost string `json:"ntlmHost,omitempty"`
Password string `json:"password,omitempty"`
NTLMDomain string `json:"ntlmDomain,omitempty"`
NTLMHost string `json:"ntlmHost,omitempty"`
Password string `json:"password,omitempty"`
Type HTTPClientAuthenticationType `json:"type"`
Username string `json:"username,omitempty"`
Username string `json:"username,omitempty"`
// Whether to use pre-emptive authentication. Use with caution. Defaults to false.
Preemptive *bool `json:"preemptive,omitempty"`
}
2 changes: 1 addition & 1 deletion scripts/gofmtcheck.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ if [[ -n ${gofmt_files} ]]; then
exit 1
fi

exit 0
exit 0

0 comments on commit 02aebbe

Please sign in to comment.