From 97bf53cb4a80456cd141cfcd2770995fb35391ba Mon Sep 17 00:00:00 2001 From: "A.Unger" Date: Fri, 22 May 2020 12:33:20 +0200 Subject: [PATCH] use golangci-lint as linter --- .drone.star | 4 ++-- .golangci.yaml | 34 ++++++++++++++++++++++++++++++++++ Makefile | 4 ---- 3 files changed, 36 insertions(+), 6 deletions(-) create mode 100644 .golangci.yaml diff --git a/.drone.star b/.drone.star index a204a15ed..35ab9d185 100644 --- a/.drone.star +++ b/.drone.star @@ -62,10 +62,10 @@ def testing(ctx): }, { 'name': 'staticcheck', - 'image': 'webhippie/golang:1.13', + 'image': 'golangci/golangci-lint:latest', 'pull': 'always', 'commands': [ - 'make staticcheck', + 'golangci-lint run', ], 'volumes': [ { diff --git a/.golangci.yaml b/.golangci.yaml new file mode 100644 index 000000000..222f70873 --- /dev/null +++ b/.golangci.yaml @@ -0,0 +1,34 @@ +issues: + # exclude-rules: + # - path: pkg/proto/v0/settings.pb.go + # text: "SA1019:" + # linters: + # - staticcheck + # - path: pkg/store/filesystem/io.go + # text: "SA1019:" + # linters: + # - staticcheck +linters: + enable: + - bodyclose + - deadcode + - errcheck + - gosimple + - govet + - ineffassign + - staticcheck + - structcheck + - typecheck + - unused + - varcheck + - depguard + - golint + - goimports + - unconvert + - scopelint + - maligned + - misspell + # - gocritic + - prealloc + #- gosec + diff --git a/Makefile b/Makefile index 9c699b898..322a135c5 100644 --- a/Makefile +++ b/Makefile @@ -69,10 +69,6 @@ fmt: vet: go vet $(PACKAGES) -.PHONY: staticcheck -staticcheck: - go run honnef.co/go/tools/cmd/staticcheck -tags '$(TAGS)' $(PACKAGES) - .PHONY: lint lint: for PKG in $(PACKAGES); do go run golang.org/x/lint/golint -set_exit_status $$PKG || exit 1; done;