Stricter linting (#113)

This commit is contained in:
Adrian Macneil 2020-01-01 19:11:02 -10:00 committed by GitHub
parent 810bddaea8
commit 98066fadaa
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 33 additions and 3 deletions

26
.golangci.yml Normal file
View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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() {

View file

@ -279,7 +279,6 @@ func (db *DB) Migrate() error {
if err != nil {
return err
}
}
// automatically update schema file, silence errors