We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
When configuring max configuration value for interfacebloat linter, nothing changes.
max
interfacebloat
The culprit seems to be incorrect configuration handling in NewInterfaceBloat, configuration is not passed:
NewInterfaceBloat
return goanalysis.NewLinter( a.Name, a.Doc, []*analysis.Analyzer{a}, nil, ).WithLoadMode(goanalysis.LoadModeSyntax)
Changing it to the following fixes the problem:
return goanalysis.NewLinter( a.Name, a.Doc, []*analysis.Analyzer{a}, cfgMap, ).WithLoadMode(goanalysis.LoadModeSyntax)
golangci-lint has version 1.49.0 built from cc2d97f3 on 2022-08-24T10:24:37Z
linters: enable: - interfacebloat linters-settings: interfacebloat: max: 1
$ go version && go env GO111MODULE="on" GOARCH="amd64" GOBIN="" GOCACHE="/home/akachurin/.cache/go-build" GOENV="/home/akachurin/.config/go/env" GOEXE="" GOEXPERIMENT="" GOFLAGS="" GOHOSTARCH="amd64" GOHOSTOS="linux" GOINSECURE="" GOMODCACHE="/home/akachurin/go/pkg/mod" GONOPROXY="" GONOSUMDB="" GOOS="linux" GOPATH="/home/akachurin/go" GOPRIVATE="" GOPROXY="https://proxy.golang.org,direct" GOROOT="/snap/go/current" GOSUMDB="sum.golang.org" GOTMPDIR="" GOTOOLDIR="/snap/go/current/pkg/tool/linux_amd64" GOVCS="" GOVERSION="go1.19" GCCGO="/usr/bin/gccgo" GOAMD64="v1" AR="ar" CC="gcc" CXX="g++" CGO_ENABLED="1" GOMOD="/home/akachurin/GolandProjects/awesomeProject/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 -pthread -Wl,--no-gc-sections -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build810072952=/tmp/go-build -gno-record-gcc-switches"
$ golangci-lint cache clean $ golangci-lint run -v INFO [config_reader] Config search paths: [./ /home/akachurin/GolandProjects/awesomeProject /home/akachurin/GolandProjects /home/akachurin /home /] INFO [config_reader] Used config file .golangci.yml INFO [lintersdb] Active 8 linters: [errcheck gosimple govet ineffassign interfacebloat staticcheck typecheck unused] INFO [loader] Go packages loading at mode 575 (files|imports|compiled_files|exports_file|types_sizes|deps|name) took 5.275142ms INFO [runner/filename_unadjuster] Pre-built 0 adjustments in 57.575µs INFO [linters context/goanalysis] analyzers took 4.805985ms with top 10 stages: printf: 226.904µs, fact_deprecated: 199.072µs, buildir: 152.661µs, ctrlflow: 116.967µs, atomic: 114.7µs, typedness: 110.951µs, sigchanyzer: 100.285µs, fact_purity: 95.948µs, S1004: 93.358µs, loopclosure: 75.59µs INFO [runner] processing took 1.837µs with stages: max_same_issues: 337ns, skip_dirs: 175ns, max_from_linter: 169ns, nolint: 163ns, filename_unadjuster: 138ns, skip_files: 130ns, cgo: 94ns, exclude: 90ns, path_prettifier: 88ns, autogenerated_exclude: 84ns, uniq_by_line: 82ns, exclude-rules: 35ns, source_code: 34ns, path_shortener: 33ns, sort_results: 33ns, diff: 32ns, identifier_marker: 31ns, severity-rules: 30ns, max_per_file_from_linter: 30ns, path_prefixer: 29ns INFO [runner] linters took 2.766386ms with stages: goanalysis_metalinter: 2.744519ms INFO File cache stats: 0 entries of total size 0B INFO Memory: 2 samples, avg is 35.5MB, max is 37.9MB INFO Execution took 10.660817ms
package example type BiggerOne interface { // interfacebloat max is set to 1 i1() i2() i3() }
The text was updated successfully, but these errors were encountered:
Hey, thank you for opening your first Issue ! 🙂 If you would like to contribute we have a guide for contributors.
Sorry, something went wrong.
Successfully merging a pull request may close this issue.
Welcome
Description of the problem
When configuring
max
configuration value forinterfacebloat
linter, nothing changes.The culprit seems to be incorrect configuration handling in
NewInterfaceBloat
, configuration is not passed:Changing it to the following fixes the problem:
Version of golangci-lint
golangci-lint has version 1.49.0 built from cc2d97f3 on 2022-08-24T10:24:37Z
Configuration file
Go environment
Verbose output of running
Code example or link to a public repository
The text was updated successfully, but these errors were encountered: