From 51fc038380062aec71b4e39af9227c6db0be4fd8 Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Tue, 23 Apr 2019 16:58:23 +0300 Subject: .golangci.yml: update Enable more linters. Tune settings for existings. Fix excludes. Update #977 --- .golangci.yml | 19 +++++++++++++++---- Makefile | 6 ++++++ 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index 7abce1602..443aa5d19 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -5,7 +5,7 @@ run: deadline: 8m skip-dirs: - pkg/kd - - pkg/ifuzz/gen + - pkg/ifuzz/generated - sys/akaros/gen - sys/freebsd/gen - sys/fuchsia/gen @@ -21,10 +21,10 @@ run: linters: enable: - lll + - vet - gofmt - golint - structcheck - - megacheck - unconvert - deadcode - goconst @@ -33,13 +33,20 @@ linters: - varcheck - misspell - gocyclo - - vet - vetshadow - megacheck + - stylecheck - govet disable: + - typecheck - ineffassign - errcheck + - interfacer + - unparam + - nakedret + - prealloc + - scopelint + - gocritic linters-settings: lll: @@ -48,15 +55,19 @@ linters-settings: min-complexity: 24 dupl: threshold: 60 + goconst: + min-len: 7 + min-occurrences: 4 issues: exclude-use-default: false exclude: - "exported .* should have comment" - "comment on .* should be of the form" - - "(sys/.*/init.*|sys/targets/common.go).* don't use ALL_CAPS in Go names" - "declaration of \"err\" shadows" exclude-rules: - path: (pkg/csource/generated.go|pkg/report/linux.go|pkg/build/linux_generated.go) linters: - lll + - path: (sys/.*/init.*|sys/targets/common.go) + text: "don't use ALL_CAPS in Go names" diff --git a/Makefile b/Makefile index 511142a5f..71fd97c07 100644 --- a/Makefile +++ b/Makefile @@ -239,6 +239,12 @@ else env CGO_ENABLED=1 GOMAXPROCS=1 GOGC=50 gometalinter.v2 ./... endif +lint: + # To install run: + # go get -u github.com/golangci/golangci-lint/cmd/golangci-lint + # Currently it consumes too much memory to run on Travis (see #977). + golangci-lint run ./... + arch: arch_darwin_amd64_host arch_linux_amd64_host arch_freebsd_amd64_host \ arch_netbsd_amd64_host arch_openbsd_amd64_host \ arch_linux_amd64_target arch_linux_386_target \ -- cgit mrf-deployment