-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
pkg/golinters: maybe do not exclude govet internal analysers #915
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
It is very strange since func getDefaultAnalyzers() []*analysis.Analyzer {
return []*analysis.Analyzer{
asmdecl.Analyzer,
assign.Analyzer,
atomic.Analyzer,
bools.Analyzer,
buildtag.Analyzer,
cgocall.Analyzer,
composite.Analyzer,
copylock.Analyzer,
errorsas.Analyzer,
httpresponse.Analyzer,
loopclosure.Analyzer,
lostcancel.Analyzer,
nilfunc.Analyzer,
printf.Analyzer,
shift.Analyzer,
stdmethods.Analyzer,
structtag.Analyzer,
tests.Analyzer,
unmarshal.Analyzer,
unreachable.Analyzer,
unsafeptr.Analyzer,
unusedresult.Analyzer,
}
} It is explicitly checked by linters-settings:
govet:
check-shadowing: true
settings:
printf:
funcs:
- (github.com/golangci/golangci-lint/pkg/logutils.Log).Infof
- (github.com/golangci/golangci-lint/pkg/logutils.Log).Warnf
- (github.com/golangci/golangci-lint/pkg/logutils.Log).Errorf
- (github.com/golangci/golangci-lint/pkg/logutils.Log).Fatalf So |
$ golangci-lint run -c .golangci.toml --verbose
INFO [config_reader] Used config file .golangci.toml
INFO [lintersdb] Active 1 linters: [govet]
INFO [lintersdb] Active 1 linters: [govet]
INFO [loader] Go packages loading at mode 575 (files|name|types_sizes|deps|exports_file|imports|compiled_files) took 77.405363ms
INFO [runner/filename_unadjuster] Pre-built 0 adjustments in 8.487417ms
INFO [runner/govet/goanalysis] analyzers took 0s with no stages
INFO [runner] processing took 3.634µs with stages: max_same_issues: 1.286µs, autogenerated_exclude: 470ns, nolint: 293ns, skip_dirs: 289ns, max_from_linter: 271ns, max_per_file_from_linter: 123ns, cgo: 120ns, skip_files: 118ns, diff: 116ns, identifier_marker: 115ns, path_prettifier: 112ns, filename_unadjuster: 111ns, exclude: 43ns, source_code: 42ns, exclude-rules: 42ns, uniq_by_line: 42ns, path_shortener: 41ns
INFO [runner] linters took 25.087378ms with stages: govet: 25.055116ms
INFO File cache stats: 0 entries of total size 0B
INFO Memory: 3 samples, avg is 69.5MB, max is 69.7MB
INFO Execution took 115.101269ms
$ cat .golangci.toml
[linters]
disable-all = true
enable = [ "govet" ]
[linters-settings.govet.settings.printf]
funcs = [
"warnf",
"infof",
"errorf",
"logf",
"printf",
"warningf",
"fatalf",
"sprintf",
"fprintf",
"panicf",
]
$ golangci-lint --version
golangci-lint has version 1.22.2 built from cb2f8ba on 2019-12-30T19:26:28Z Actually I can't even reproduce :( Are you sure that you are using correctly built version of |
I had the same issue as @carnott-snap. When I was having the issue I noticed this:
Thanks to @ernado it became apparent that my install (from
|
@mec07 thanks to your comment I figured out that the after adding the same line however, it seems to me that the real issue is |
It looks like excluding internal analysers, as was done in #763, is causing my config to fail, because
linters-settings.govet.settings.printf
no longer exists.Version of golangci-lint
Config file
Go environment
Verbose output of running
The text was updated successfully, but these errors were encountered: