From 8d014d8be7615cae86f57bc7ba5b3d65c2c2abdb Mon Sep 17 00:00:00 2001 From: Jonathan Hall Date: Tue, 2 Apr 2019 20:11:01 +0200 Subject: [PATCH] Switch to new linter --- .golangci.toml | 9 +++++++++ .linter.json | 6 ------ .linter_test.json | 7 ------- travis/install.sh | 3 +-- travis/test.sh | 5 +---- 5 files changed, 11 insertions(+), 19 deletions(-) create mode 100644 .golangci.toml delete mode 100644 .linter.json delete mode 100644 .linter_test.json diff --git a/.golangci.toml b/.golangci.toml new file mode 100644 index 0000000..2949d72 --- /dev/null +++ b/.golangci.toml @@ -0,0 +1,9 @@ +[output] +format = "colored-line-number" + +[linters] +enable = [ + "interfacer", "gocyclo", "unconvert", "goimports", "unused", "varcheck", + "vetshadow", "misspell", "nakedret", "errcheck", "golint", "ineffassign", + "deadcode", "goconst", "vet", "unparam", "gofmt" +] diff --git a/.linter.json b/.linter.json deleted file mode 100644 index a20abcc..0000000 --- a/.linter.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "Enable": ["gofmt", "vet", "golint", "ineffassign", "vetshadow", "gas", "unparam", "unused", "varcheck"], - "Vendor": true, - "Test": true, - "Deadline": "60s" -} diff --git a/.linter_test.json b/.linter_test.json deleted file mode 100644 index ec8fbff..0000000 --- a/.linter_test.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "Enable": ["errcheck"], - "Exclude": ["_test.go:[0-9]+:[0-9]+:"], - "Vendor": true, - "Test": true, - "Deadline": "60s" -} diff --git a/travis/install.sh b/travis/install.sh index c1c9737..1e0437b 100755 --- a/travis/install.sh +++ b/travis/install.sh @@ -18,8 +18,7 @@ case "$1" in generate ;; "linter") - go get -u gopkg.in/alecthomas/gometalinter.v1 - gometalinter.v1 --install + curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b $(go env GOPATH)/bin v1.17.1 ;; "coverage") generate diff --git a/travis/test.sh b/travis/test.sh index 6fd0c51..14cff76 100755 --- a/travis/test.sh +++ b/travis/test.sh @@ -15,10 +15,7 @@ case "$1" in gopherjs test $(go list ./... | grep -v /vendor/ | grep -Ev 'kivik/(serve|auth|proxy)') ;; "linter") - diff -u <(echo -n) <(gofmt -e -d $(find . -type f -name '*.go' -not -path "./vendor/*")) - go install # to make gotype (run by gometalinter) happy - gometalinter.v1 --config .linter_test.json - gometalinter.v1 --config .linter.json + golangci-lint run ./... ;; "coverage") echo "" > coverage.txt