use golangci-lint as linter

This commit is contained in:
A.Unger
2020-05-22 12:33:20 +02:00
parent 23c91ca4ce
commit 97bf53cb4a
3 changed files with 36 additions and 6 deletions

View File

@@ -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': [
{

34
.golangci.yaml Normal file
View File

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

View File

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