diff --git a/.golangci.yml b/.golangci.yml new file mode 100644 index 0000000..34cc2bf --- /dev/null +++ b/.golangci.yml @@ -0,0 +1,26 @@ +linters: + enable: + - bodyclose + - deadcode + - depguard + - errcheck + - goimports + - gosimple + - govet + - ineffassign + - misspell + - nakedret + - staticcheck + - structcheck + - typecheck + - unconvert + - unparam + - unused + - varcheck + - whitespace + +linters-settings: + goimports: + local-prefixes: github.com/amacneil/dbmate + misspell: + locale: US diff --git a/Dockerfile b/Dockerfile index 08d62d0..9aec0dd 100644 --- a/Dockerfile +++ b/Dockerfile @@ -19,7 +19,7 @@ RUN apt-get update \ # golangci-lint RUN curl -fsSL -o /tmp/lint-install.sh https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh \ && chmod +x /tmp/lint-install.sh \ - && /tmp/lint-install.sh -b /usr/local/bin v1.18.0 \ + && /tmp/lint-install.sh -b /usr/local/bin v1.22.2 \ && rm -f /tmp/lint-install.sh # download modules diff --git a/Makefile b/Makefile index 4399c93..a30f845 100644 --- a/Makefile +++ b/Makefile @@ -7,6 +7,10 @@ all: test lint build test: go test -v ./... +.PHONY: fix +fix: + golangci-lint run --fix + .PHONY: lint lint: golangci-lint run diff --git a/main.go b/main.go index fb1ee5f..61d24f0 100644 --- a/main.go +++ b/main.go @@ -6,9 +6,10 @@ import ( "net/url" "os" - "github.com/amacneil/dbmate/pkg/dbmate" "github.com/joho/godotenv" "github.com/urfave/cli" + + "github.com/amacneil/dbmate/pkg/dbmate" ) func main() { diff --git a/pkg/dbmate/db.go b/pkg/dbmate/db.go index f7a786d..5917b21 100644 --- a/pkg/dbmate/db.go +++ b/pkg/dbmate/db.go @@ -279,7 +279,6 @@ func (db *DB) Migrate() error { if err != nil { return err } - } // automatically update schema file, silence errors