You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I tried to configure specific severity for some revive's rules but they are completely ignored.
I tried with revive directly and it works perfectly with this config file:
# When set to false, ignores files with "GENERATED" header, similar to golintignoreGeneratedHeader = true# Sets the default severity to "warning"severity = "error"# Sets the default failure confidence. This means that linting errors# with less than 0.8 confidence will be ignored.confidence = 0.8# Sets the error code for failures with severity "error"errorCode = 0# Sets the error code for failures with severity "warning"warningCode = 0# Configuration of the `cyclomatic` rule. Here we specify that# the rule should fail if it detects code with higher complexity than 10.
[rule.var-naming]
severity = "warning"
Version of golangci-lint
$ golangci-lint --versiongolangci-lint has version 1.48.0 built from 2d8fea81 on 2022-08-04T18:44:38Z
$ go version && go envgo version go1.18.3 linux/amd64GO111MODULE=""GOARCH="amd64"GOBIN=""GOCACHE="/home/hbollon/.cache/go-build"GOENV="/home/hbollon/.config/go/env"GOEXE=""GOEXPERIMENT=""GOFLAGS=""GOHOSTARCH="amd64"GOHOSTOS="linux"GOINSECURE=""GOMODCACHE="/home/hbollon/go/pkg/mod"GONOPROXY=""GONOSUMDB=""GOOS="linux"GOPATH="/home/hbollon/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.18.3"GCCGO="gccgo"GOAMD64="v1"AR="ar"CC="gcc"CXX="g++"CGO_ENABLED="0"GOMOD="/home/hbollon/git/camptocamp/github.com/pulumi-aws-schweizmobil/go.mod"GOWORK=""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 -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build3768830388=/tmp/go-build -gno-record-gcc-switches"
Verbose output of running
$ golangci-lint cache clean
$ golangci-lint run -vINFO [config_reader] Config search paths: [./ /home/hbollon/git/camptocamp/github.com/pulumi-aws-schweizmobil /home/hbollon/git/camptocamp/github.com /home/hbollon/git/camptocamp /home/hbollon/git /home/hbollon /home /] INFO [config_reader] Used config file .golangci.yml INFO [lintersdb] Active 23 linters: [deadcode errcheck exportloopref goconst godox gofmt goimports gosec gosimple govet ineffassign lll misspell prealloc revive rowserrcheck staticcheck typecheck unconvert unparam unused varcheck whitespace] INFO [loader] Go packages loading at mode 575 (exports_file|imports|name|types_sizes|compiled_files|deps|files) took 297.133506ms INFO [runner/filename_unadjuster] Pre-built 0 adjustments in 3.516474ms WARN [linter] revive: the following rules (context-keys-type,errorf,time-naming,unexported-return,var-declaration) are ignored due to a performance problem (https://github.com/golangci/golangci-lint/issues/2997) WARN [linter] revive: the following rules (context-keys-type,errorf,time-naming,unexported-return,var-declaration) are ignored due to a performance problem (https://github.com/golangci/golangci-lint/issues/2997) WARN [linter] revive: the following rules (context-keys-type,errorf,time-naming,unexported-return,var-declaration) are ignored due to a performance problem (https://github.com/golangci/golangci-lint/issues/2997) WARN [linter] revive: the following rules (context-keys-type,errorf,time-naming,unexported-return,var-declaration) are ignored due to a performance problem (https://github.com/golangci/golangci-lint/issues/2997) WARN [linter] revive: the following rules (context-keys-type,errorf,time-naming,unexported-return,var-declaration) are ignored due to a performance problem (https://github.com/golangci/golangci-lint/issues/2997) WARN [linter] revive: the following rules (context-keys-type,errorf,time-naming,unexported-return,var-declaration) are ignored due to a performance problem (https://github.com/golangci/golangci-lint/issues/2997) INFO [linters context/goanalysis] analyzers took 28.882281765s with top 10 stages: buildir: 22.87677273s, inspect: 1.227991458s, fact_deprecated: 961.468251ms, ctrlflow: 795.982667ms, printf: 661.610435ms, buildssa: 460.026843ms, nilness: 415.28584ms, fact_purity: 410.979807ms, SA5012: 278.633748ms, typedness: 272.857575ms WARN [linters context] rowserrcheck is disabled because of generics. You can track the evolution of the generics support by following the https://github.com/golangci/golangci-lint/issues/2649. INFO [runner] Issues before processing: 54, after processing: 8 INFO [runner] Processors filtering stat (out/in): autogenerated_exclude: 54/54, severity-rules-case-sensitive: 8/8, path_prefixer: 8/8, sort_results: 8/8, cgo: 54/54, skip_files: 54/54, uniq_by_line: 8/8, source_code: 8/8, path_shortener: 8/8, filename_unadjuster: 54/54, identifier_marker: 54/54, exclude: 54/54, diff: 8/8, max_same_issues: 8/8, path_prettifier: 54/54, exclude-rules: 8/54, nolint: 8/8, max_per_file_from_linter: 8/8, max_from_linter: 8/8, skip_dirs: 54/54 INFO [runner] processing took 5.025759ms with stages: exclude-rules: 2.342011ms, identifier_marker: 1.184585ms, nolint: 1.026599ms, path_prettifier: 226.442µs, autogenerated_exclude: 115.616µs, skip_dirs: 57.544µs, source_code: 55.683µs, uniq_by_line: 4.459µs, cgo: 3.697µs, path_shortener: 3.105µs, filename_unadjuster: 2.186µs, severity-rules-case-sensitive: 1.212µs, max_per_file_from_linter: 987ns, max_same_issues: 546ns, skip_files: 229ns, exclude: 221ns, diff: 187ns, max_from_linter: 182ns, sort_results: 161ns, path_prefixer: 107ns INFO [runner] linters took 6.877429384s with stages: goanalysis_metalinter: 6.872331656s, rowserrcheck: 6.736µs internal/pkg/components/foundations/dns.go:42:28: Error return value of `f.errorWrapper.Wrap` is not checked (errcheck) defer f.errorWrapper.Wrap(err) ^internal/pkg/components/foundations/ecr.go:67: internal/pkg/components/foundations/ecr.go:67: Line contains TODO/BUG/FIXME: "TODO" (godox) // TODOinternal/pkg/components/foundations/ecr.go:72: internal/pkg/components/foundations/ecr.go:72: Line contains TODO/BUG/FIXME: "TODO" (godox) // TODOinternal/pkg/components/foundations/ecr.go:113: internal/pkg/components/foundations/ecr.go:113: Line contains TODO/BUG/FIXME: "TODO" (godox) // TODOinternal/pkg/components/foundations/ecr.go:118: internal/pkg/components/foundations/ecr.go:118: Line contains TODO/BUG/FIXME: "TODO" (godox) // TODOinternal/pkg/components/foundations/network.go:107: internal/pkg/components/foundations/network.go:107: Line contains TODO/BUG/FIXME: "TODO" (godox) // TODOinternal/pkg/components/foundations/dns.go:13:23: var-naming: method newDnsZone should be newDNSZone (revive)func (f *Foundations) newDnsZone(ctx *pulumi.Context) (err error) { ^internal/pkg/components/foundations/foundations.go:85:6: exported: type name will be used as foundations.FoundationsArgs by other packages, and that stutters; consider calling this Args (revive)type FoundationsArgs struct { ^INFO File cache stats: 19 entries of total size 61.7KiB INFO Memory: 73 samples, avg is 462.4MB, max is 667.2MB INFO Execution took 7.182767414s
Additionally, there is severity informations parsed with jq:
$ golangci-lint run --out-format json | jq '.Issues[] | {text: .Text, severity: .Severity }'WARN [linters context] rowserrcheck is disabled because of generics. You can track the evolution of the generics support by following the https://github.com/golangci/golangci-lint/issues/2649. { "text": "Error return value of `f.errorWrapper.Wrap` is not checked", "severity": "error"}{ "text": "internal/pkg/components/foundations/ecr.go:67: Line contains TODO/BUG/FIXME: \"TODO\"", "severity": "warning"}{ "text": "internal/pkg/components/foundations/ecr.go:72: Line contains TODO/BUG/FIXME: \"TODO\"", "severity": "warning"}{ "text": "internal/pkg/components/foundations/ecr.go:113: Line contains TODO/BUG/FIXME: \"TODO\"", "severity": "warning"}{ "text": "internal/pkg/components/foundations/ecr.go:118: Line contains TODO/BUG/FIXME: \"TODO\"", "severity": "warning"}{ "text": "internal/pkg/components/foundations/network.go:107: Line contains TODO/BUG/FIXME: \"TODO\"", "severity": "warning"}{ "text": "var-naming: method newDnsZone should be newDNSZone", "severity": "error"}{ "text": "exported: type name will be used as foundations.FoundationsArgs by other packages, and that stutters; consider calling this Args", "severity": "error"}
var-naming and exported should be at warning level according to my configuration file...
$ golangci-lint run --out-format json | jq '.Issues[] | {text: .Text, severity: .Severity }'WARN [linters context] rowserrcheck is disabled because of generics. You can track the evolution of the generics support by following the https://github.com/golangci/golangci-lint/issues/2649. { "text": "Error return value is not checked", "severity": "error"}{ "text": "var-naming: func newDnsZone should be newDNSZone", "severity": "error"}
Which is not the intended result since the var-naming rule appear as error and not warning
The text was updated successfully, but these errors were encountered:
Welcome
Description of the problem
I tried to configure specific severity for some revive's rules but they are completely ignored.
I tried with revive directly and it works perfectly with this config file:
Version of golangci-lint
Configuration file
Go environment
Verbose output of running
Additionally, there is severity informations parsed with jq:
var-naming
andexported
should be at warning level according to my configuration file...Code example or link to a public repository
With my config it should return:
Which is not the intended result since the
var-naming
rule appear as error and not warningThe text was updated successfully, but these errors were encountered: