use golangci linters

This commit is contained in:
A.Unger
2020-05-22 09:12:08 +02:00
parent ea49cedac4
commit 917839a6db
4 changed files with 40 additions and 6 deletions

View File

@@ -73,10 +73,10 @@ def testing(ctx):
},
{
'name': 'staticcheck',
'image': 'webhippie/golang:1.13',
'image': image: golangci/golangci-lint:latest',
'pull': 'always',
'commands': [
'make staticcheck',
golangci-lint run,
],
'volumes': [
{

34
.golangci.yml 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

@@ -71,9 +71,9 @@ fmt:
vet:
go vet $(PACKAGES)
.PHONY: staticcheck
staticcheck:
go run honnef.co/go/tools/cmd/staticcheck -tags '$(TAGS)' $(PACKAGES)
# .PHONY: staticcheck
# staticcheck:
# go run honnef.co/go/tools/cmd/staticcheck -tags '$(TAGS)' $(PACKAGES)
.PHONY: lint
lint:

View File

@@ -7,5 +7,5 @@ import (
_ "github.com/mitchellh/gox"
_ "github.com/restic/calens"
_ "golang.org/x/lint/golint"
_ "honnef.co/go/tools/cmd/staticcheck"
// _ "honnef.co/go/tools/cmd/staticcheck"
)