Closed
Description
- Yes, I'm using a binary release within 2 latest major releases. Only such installations are supported.
- Yes, I've searched similar issues on GitHub and didn't find any.
- Yes, I've included all information below (version, config, etc).
- Yes, I've tried with the standalone linter if available. (https://golangci-lint.run/usage/linters/)
Description of the problem
I have enabled stylecheck
and staticcheck
but errors from those linters are not reported. But when I tried to run staticcheck directly, errors are reported.
When I run staticcheck ./...
with following staticcheck.conf
file, I got this error:
ast/astutils/matchers.go:67:1: comment on exported function MatchVariableNode should be of the form "MatchVariableNode ..." (ST1020)
checks = ["all", "-ST1000", "ST1003", "ST1016", "ST1020", "ST1021", "ST1022", "ST1023"]
http_status_code_whitelist = ["200", "400", "404", "500"]
Version of golangci-lint
$ golangci-lint --version
golangci-lint has version v1.40.1 built from (unknown, mod sum: "h1:pBrCqt9BgI9LfGCTKRTSe1DfMjR6BkOPERPaXJYXA6Q=") on (unknown)
Config file
---
linters:
enable:
# By Default
- deadcode
- errcheck
- gosimple
- govet
- ineffassign
- staticcheck
- structcheck
- typecheck
- unused
- varcheck
# Extra
- asciicheck
- cyclop
- gocritic
- gofmt
- goimports
- gosec
- ifshort
- lll
- prealloc
- stylecheck
- unconvert
- whitespace
linters-settings:
lll:
line-length: 120
tab-width: 4
goimports:
local-prefixes: github.com/arxeiss/go-expression-calculator
cyclop:
max-complexity: 15
staticcheck:
go: "1.15"
checks: ["all", "ST1000", "ST1003", "ST1016", "ST1020", "ST1021", "ST1022"]
stylecheck:
go: "1.15"
checks: ["all", "ST1000", "ST1003", "ST1016", "ST1020", "ST1021", "ST1022"]
Go environment
$ go version && go env
go version go1.16.4 linux/amd64
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/pavel/.cache/go-build"
GOENV="/home/pavel/.config/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GOMODCACHE="/home/pavel/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/home/pavel/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
GOVCS=""
GOVERSION="go1.16.4"
GCCGO="gccgo"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/home/pavel/Projects/go-expression-calculator/go.mod"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build2099628751=/tmp/go-build -gno-record-gcc-switches"
Verbose output of running
$ golangci-lint cache clean
$ golangci-lint run -v
INFO [config_reader] Config search paths: [./ /home/pavel/Projects/go-expression-calculator /home/pavel/Projects /home/pavel /home /]
INFO [config_reader] Used config file .golangci.yml
INFO [lintersdb] Active 22 linters: [asciicheck cyclop deadcode errcheck gocritic gofmt goimports gosec gosimple govet ifshort ineffassign lll prealloc staticcheck structcheck stylecheck typecheck unconvert unused varcheck whitespace]
INFO [loader] Go packages loading at mode 575 (deps|imports|name|compiled_files|exports_file|files|types_sizes) took 417.000733ms
INFO [runner/filename_unadjuster] Pre-built 0 adjustments in 2.720999ms
INFO [linters context/goanalysis] analyzers took 21.511864334s with top 10 stages: buildir: 12.806920456s, inspect: 1.414562645s, nilness: 607.938652ms, fact_purity: 569.27192ms, unconvert: 510.018044ms, ctrlflow: 309.083567ms, fact_deprecated: 267.834694ms, SA5012: 207.484293ms, printf: 205.213689ms, typedness: 135.840184ms
INFO [runner] Issues before processing: 14, after processing: 0
INFO [runner] Processors filtering stat (out/in): path_prettifier: 14/14, skip_files: 14/14, skip_dirs: 14/14, exclude-rules: 1/14, cgo: 14/14, filename_unadjuster: 14/14, autogenerated_exclude: 14/14, identifier_marker: 14/14, exclude: 14/14, nolint: 0/1
INFO [runner] processing took 1.945526ms with stages: exclude-rules: 707.244µs, nolint: 390.85µs, identifier_marker: 368.596µs, path_prettifier: 226.327µs, autogenerated_exclude: 182.129µs, skip_dirs: 58.827µs, cgo: 3.826µs, filename_unadjuster: 2.794µs, max_same_issues: 1.019µs, uniq_by_line: 640ns, diff: 463ns, source_code: 431ns, max_from_linter: 400ns, skip_files: 362ns, path_shortener: 303ns, severity-rules: 301ns, exclude: 282ns, sort_results: 258ns, max_per_file_from_linter: 256ns, path_prefixer: 218ns
INFO [runner] linters took 8.461816362s with stages: goanalysis_metalinter: 8.459776403s
INFO File cache stats: 0 entries of total size 0B
INFO Memory: 90 samples, avg is 387.0MB, max is 608.0MB
INFO Execution took 8.888381835s
Code example or link to a public repository
// MatchXXX expects types.GomegaMatcher or passed name will be compared with gomega.Equal
func MatchVariableNode(name interface{}) types.GomegaMatcher {
return &variableMatcher{
name: name,
}
}