diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 7e15a0a..681dfec 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -12,9 +12,14 @@ repos: - repo: https://github.com/tekwizely/pre-commit-golang rev: v1.0.0-rc.1 hooks: - - id: go-fmt + - id: go-fmt-repo + args: + - "-w" + - "-s" - id: go-mod-tidy - - id: go-imports + - id: go-imports-repo + args: + - "-w" # FIX ME: See https://github.com/datadrivers/go-nexus-client/issues/122 # - id: go-vet # - id: golangci-lint-mod diff --git a/nexus3/nexus.go b/nexus3/nexus.go index 6f5a0c2..80bbae7 100644 --- a/nexus3/nexus.go +++ b/nexus3/nexus.go @@ -3,8 +3,8 @@ package nexus3 import ( "github.com/datadrivers/go-nexus-client/nexus3/pkg/blobstore" "github.com/datadrivers/go-nexus-client/nexus3/pkg/client" - "github.com/datadrivers/go-nexus-client/nexus3/pkg/readonly" "github.com/datadrivers/go-nexus-client/nexus3/pkg/deprecated" + "github.com/datadrivers/go-nexus-client/nexus3/pkg/readonly" "github.com/datadrivers/go-nexus-client/nexus3/pkg/repository" "github.com/datadrivers/go-nexus-client/nexus3/pkg/security" ) diff --git a/nexus3/pkg/readonly/service.go b/nexus3/pkg/readonly/service.go index a6d99e8..9976ff8 100644 --- a/nexus3/pkg/readonly/service.go +++ b/nexus3/pkg/readonly/service.go @@ -4,9 +4,10 @@ import ( "encoding/json" "errors" "fmt" + "net/http" + "github.com/datadrivers/go-nexus-client/nexus3/pkg/client" "github.com/datadrivers/go-nexus-client/nexus3/schema/readonly" - "net/http" ) const ( diff --git a/nexus3/pkg/readonly/service_test.go b/nexus3/pkg/readonly/service_test.go index e88fd91..189046c 100644 --- a/nexus3/pkg/readonly/service_test.go +++ b/nexus3/pkg/readonly/service_test.go @@ -1,10 +1,11 @@ package readonly import ( + "testing" + "github.com/datadrivers/go-nexus-client/nexus3/pkg/client" "github.com/datadrivers/go-nexus-client/nexus3/pkg/tools" "github.com/stretchr/testify/assert" - "testing" ) var ( diff --git a/nexus3/script_test.go b/nexus3/script_test.go index 46a7d00..703c675 100644 --- a/nexus3/script_test.go +++ b/nexus3/script_test.go @@ -64,12 +64,12 @@ func TestScriptList(t *testing.T) { scripts, err := client.Script.List() assert.Nil(t, err) expectedScripts := []schema.Script{ - schema.Script{ + { Name: "helloWorld", Content: "log.info('Hello, World!')", Type: "groovy", }, - schema.Script{ + { Name: "HelloTest", Content: "log.info('Hello, Test!')", Type: "groovy",