From 9f28310fa993596ef061bc3b37ceed6f80a63ec3 Mon Sep 17 00:00:00 2001 From: fabrue Date: Mon, 14 Aug 2023 16:47:29 +0200 Subject: [PATCH] ran pre-commit --- .pre-commit-config.yaml | 9 +++++++++ nexus3/pkg/repository/bower/proxy.go | 2 +- nexus3/pkg/repository/bower/service.go | 1 + nexus3/pkg/repository/maven/proxy_test.go | 2 +- nexus3/pkg/repository/npm/group_test.go | 1 - nexus3/schema/repository/bower.go | 2 +- nexus3/schema/repository/http_client.go | 8 ++++---- 7 files changed, 17 insertions(+), 8 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 1e46462..7e15a0a 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -9,3 +9,12 @@ repos: 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 diff --git a/nexus3/pkg/repository/bower/proxy.go b/nexus3/pkg/repository/bower/proxy.go index edd589b..43f3a6a 100644 --- a/nexus3/pkg/repository/bower/proxy.go +++ b/nexus3/pkg/repository/bower/proxy.go @@ -12,7 +12,7 @@ import ( ) const ( - bowerProxyAPIEndpoint = repositoryBowerAPIEndpoint + "/proxy" + bowerProxyAPIEndpoint = repositoryBowerAPIEndpoint + "/proxy" ) type RepositoryBowerProxyService struct { diff --git a/nexus3/pkg/repository/bower/service.go b/nexus3/pkg/repository/bower/service.go index 746239f..02cd40f 100644 --- a/nexus3/pkg/repository/bower/service.go +++ b/nexus3/pkg/repository/bower/service.go @@ -8,6 +8,7 @@ import ( const ( repositoryBowerAPIEndpoint = common.RepositoryAPIEndpoint + "/bower" ) + type RepositoryBowerService struct { client *client.Client diff --git a/nexus3/pkg/repository/maven/proxy_test.go b/nexus3/pkg/repository/maven/proxy_test.go index c30e3f3..c096bb5 100644 --- a/nexus3/pkg/repository/maven/proxy_test.go +++ b/nexus3/pkg/repository/maven/proxy_test.go @@ -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", diff --git a/nexus3/pkg/repository/npm/group_test.go b/nexus3/pkg/repository/npm/group_test.go index f9d1160..3697d63 100644 --- a/nexus3/pkg/repository/npm/group_test.go +++ b/nexus3/pkg/repository/npm/group_test.go @@ -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) diff --git a/nexus3/schema/repository/bower.go b/nexus3/schema/repository/bower.go index d41efc4..1d0ad93 100644 --- a/nexus3/schema/repository/bower.go +++ b/nexus3/schema/repository/bower.go @@ -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 { diff --git a/nexus3/schema/repository/http_client.go b/nexus3/schema/repository/http_client.go index ee8fbcb..04d9ff9 100644 --- a/nexus3/schema/repository/http_client.go +++ b/nexus3/schema/repository/http_client.go @@ -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"` }