Skip to content

Commit 02aebbe

Browse files
authored
Merge pull request #121 from datadrivers/chore/pre-commit-setup
chore: install pre-commit and run it for all files
2 parents 7c58872 + 9f28310 commit 02aebbe

File tree

10 files changed

+31
-11
lines changed

10 files changed

+31
-11
lines changed

.gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
scripts/license.lic
1+
scripts/license.lic

.pre-commit-config.yaml

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
repos:
2+
- repo: https://github.com/pre-commit/pre-commit-hooks
3+
rev: v4.3.0
4+
hooks:
5+
- id: end-of-file-fixer
6+
- id: trailing-whitespace
7+
- repo: https://github.com/commitizen-tools/commitizen
8+
rev: v2.27.1
9+
hooks:
10+
- id: commitizen
11+
stages: [commit-msg]
12+
- repo: https://github.com/tekwizely/pre-commit-golang
13+
rev: v1.0.0-rc.1
14+
hooks:
15+
- id: go-fmt
16+
- id: go-mod-tidy
17+
- id: go-imports
18+
# FIX ME: See https://github.com/datadrivers/go-nexus-client/issues/122
19+
# - id: go-vet
20+
# - id: golangci-lint-mod

nexus3/pkg/repository/bower/proxy.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import (
1212
)
1313

1414
const (
15-
bowerProxyAPIEndpoint = repositoryBowerAPIEndpoint + "/proxy"
15+
bowerProxyAPIEndpoint = repositoryBowerAPIEndpoint + "/proxy"
1616
)
1717

1818
type RepositoryBowerProxyService struct {

nexus3/pkg/repository/bower/service.go

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import (
88
const (
99
repositoryBowerAPIEndpoint = common.RepositoryAPIEndpoint + "/bower"
1010
)
11+
1112
type RepositoryBowerService struct {
1213
client *client.Client
1314

nexus3/pkg/repository/maven/proxy_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ func getTestMavenProxyRepository(name string) repository.MavenProxyRepository {
3131
Proxy: repository.Proxy{
3232
ContentMaxAge: 1440,
3333
MetadataMaxAge: 1440,
34-
RemoteURL: "https://archive.ubuntu.com/ubuntu/",
34+
RemoteURL: "https://archive.ubuntu.com/ubuntu/",
3535
},
3636
Storage: repository.Storage{
3737
BlobStoreName: "default",

nexus3/pkg/repository/npm/group_test.go

-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ func TestNpmGroupRepository(t *testing.T) {
4646
repo.Group.MemberNames = append(repo.Group.MemberNames, testProxyRepo.Name)
4747
}
4848

49-
5049
err = service.Group.Create(repo)
5150
assert.Nil(t, err)
5251
generatedRepo, err := service.Group.Get(repo.Name)

nexus3/pkg/security/testfiles/saml-testconfig.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -119,4 +119,4 @@ facing addresses if this IdP is hosted behind a reverse proxy. -->
119119

120120
</IDPSSODescriptor>
121121

122-
</EntityDescriptor>
122+
</EntityDescriptor>

nexus3/schema/repository/bower.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ type BowerProxyRepository struct {
3232
RoutingRuleName *string `json:"routingRuleName,omitempty"`
3333

3434
*Cleanup `json:"cleanup,omitempty"`
35-
Bower `json:"bower"`
35+
Bower `json:"bower"`
3636
}
3737

3838
type Bower struct {

nexus3/schema/repository/http_client.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,11 @@ type HTTPClientAuthentication struct {
5454

5555
// HTTPClientAuthenticationWithPreemptive ...
5656
type HTTPClientAuthenticationWithPreemptive struct {
57-
NTLMDomain string `json:"ntlmDomain,omitempty"`
58-
NTLMHost string `json:"ntlmHost,omitempty"`
59-
Password string `json:"password,omitempty"`
57+
NTLMDomain string `json:"ntlmDomain,omitempty"`
58+
NTLMHost string `json:"ntlmHost,omitempty"`
59+
Password string `json:"password,omitempty"`
6060
Type HTTPClientAuthenticationType `json:"type"`
61-
Username string `json:"username,omitempty"`
61+
Username string `json:"username,omitempty"`
6262
// Whether to use pre-emptive authentication. Use with caution. Defaults to false.
6363
Preemptive *bool `json:"preemptive,omitempty"`
6464
}

scripts/gofmtcheck.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@ if [[ -n ${gofmt_files} ]]; then
1010
exit 1
1111
fi
1212

13-
exit 0
13+
exit 0

0 commit comments

Comments
 (0)