Replace gometalinter with golangci-lint (4.5x faster). Closes #1017

This commit is contained in:
Pedro Pombeiro 2018-06-12 18:34:24 +02:00 committed by Pedro Pombeiro
parent 5f0768472f
commit 3abfe3ffda
3 changed files with 78 additions and 38 deletions

73
.golangci.yml Normal file
View File

@ -0,0 +1,73 @@
run:
concurrency: 4
deadline: 1m
issues-exit-code: 1
tests: true
# build-tags:
# - mytag
skip-dirs:
- static
skip-files:
- .*_mock.go
- jail/doc.go
output:
format: colored-line-number
print-issued-lines: true
print-linter-name: true
linters-settings:
errcheck:
check-type-assertions: false
check-blank: false
govet:
check-shadowing: false
golint:
min-confidence: 0.8
gofmt:
simplify: true
gocyclo:
min-complexity: 16
maligned:
suggest-new: true
dupl:
threshold: 50
goconst:
min-len: 3
min-occurrences: 2
# depguard:
# list-type: blacklist
# include-go-root: false
# packages:
# - github.com/davecgh/go-spew/spew
linters:
disable-all: true
enable:
- deadcode
#- depguard
- errcheck
- gas
- goconst
- gocyclo
- gofmt
- golint
- govet
- ineffassign
- interfacer
- megacheck
#- misspell
- structcheck
- unconvert
- varcheck
fast: false
# issues:
# exclude:
# - abcdef
# exclude-use-default: true
# max-per-linter: 0
# max-same: 0
# new: false
# new-from-rev: ""
# new-from-patch: ""

View File

@ -1,35 +0,0 @@
{
"Exclude": [
".*_mock.go",
"jail/doc.go",
".*Errors unhandled.*fmt.Fprint.*gasv2.*"
],
"Skip": ["helpers", "static"],
"Vendor": true,
"Test": true,
"Linters": {
"gasv2": {
"Command": "gas -fmt=csv",
"Pattern": "^(?P<path>.*?\\.go),(?P<line>\\d+),(?P<message>[^,]+,[^,]+,[^,]+,\".*\")"
}
},
"Enable": [
"deadcode",
"errcheck",
"gasv2",
"goconst",
"gocyclo",
"gofmt",
"golint",
"ineffassign",
"interfacer",
"megacheck",
"misspell",
"structcheck",
"unconvert",
"varcheck",
"vet"
],
"Cyclo": 16,
"Deadline": "200s"
}

View File

@ -195,12 +195,14 @@ test-e2e-race: gotest_extraflags=-race
test-e2e-race: test-e2e ##@tests Run e2e tests with -race flag test-e2e-race: test-e2e ##@tests Run e2e tests with -race flag
lint-install: lint-install:
go get -u github.com/alecthomas/gometalinter go get -u github.com/client9/misspell/cmd/misspell
gometalinter --install @# The following installs a specific version of golangci-lint, which is appropriate for a CI server to avoid different results from build to build
curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | bash -s -- -b $(GOPATH)/bin v1.6.1
lint: lint:
@echo "lint" @echo "lint"
@gometalinter ./... @golangci-lint run ./...
@find . -type f -not -path "./.ethereumtest/*" -not -path "./vendor/*" -not -path "./extkeys/mnemonic.go" -not -path "./extkeys/mnemonic_vectors.json" -print0 | xargs -0 misspell
ci: lint mock dep-ensure test-unit test-e2e ##@tests Run all linters and tests at once ci: lint mock dep-ensure test-unit test-e2e ##@tests Run all linters and tests at once