Skip to content

Commit

Permalink
Chore: Improve pre-commit (#124)
Browse files Browse the repository at this point in the history
* chore: Simplify with gofmt -s

* ci: Checks and automatic write to all files at golang precommit hooks

* chore: Run precommit on all files
  • Loading branch information
anmoel authored Aug 15, 2023
1 parent 0242683 commit 30d0c08
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 7 deletions.
9 changes: 7 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion nexus3/nexus.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
Expand Down
3 changes: 2 additions & 1 deletion nexus3/pkg/readonly/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down
3 changes: 2 additions & 1 deletion nexus3/pkg/readonly/service_test.go
Original file line number Diff line number Diff line change
@@ -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 (
Expand Down
4 changes: 2 additions & 2 deletions nexus3/script_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit 30d0c08

Please sign in to comment.