golangci / golangci-lint

Fast linters runner for Go
https://golangci-lint.run
GNU General Public License v3.0
14.85k stars 1.34k forks source link

golangci-lint v1.58.2 Spurious message reported when run #4743

Closed richardwilkes closed 1 month ago

richardwilkes commented 1 month ago

Welcome

Description of the problem

As of v1.58.2, golangci-lint always emits this warning on the console:

WARN [config_reader] The configuration option linters.errcheck.ignore is deprecated, please use linters.errcheck.exclude-functions.

I don't use either of the mentioned settings and I've been unable to find any combination of settings that will remove this message. Note that this message appears whether I have a .golangci.yml file present or not.

Version of golangci-lint

```console $ golangci-lint --version golangci-lint has version 1.58.2 built with go1.22.3 from 8c4cfb61 on 2024-05-19T18:08:33Z ```

Configuration

```console # None; problem seen with or without a configuration file ```

Go environment

```console $ go version && go env go version go1.22.3 darwin/arm64 GO111MODULE='' GOARCH='arm64' GOBIN='' GOCACHE='/Users/rich/Library/Caches/go-build' GOENV='/Users/rich/Library/Application Support/go/env' GOEXE='' GOEXPERIMENT='' GOFLAGS='' GOHOSTARCH='arm64' GOHOSTOS='darwin' GOINSECURE='' GOMODCACHE='/Users/rich/go/pkg/mod' GONOPROXY='' GONOSUMDB='' GOOS='darwin' GOPATH='/Users/rich/go' GOPRIVATE='' GOPROXY='https://proxy.golang.org,direct' GOROOT='/usr/local/go' GOSUMDB='sum.golang.org' GOTMPDIR='' GOTOOLCHAIN='auto' GOTOOLDIR='/usr/local/go/pkg/tool/darwin_arm64' GOVCS='' GOVERSION='go1.22.3' GCCGO='gccgo' AR='ar' CC='clang' CXX='clang++' CGO_ENABLED='1' GOMOD='/Users/rich/code/toolbox/go.mod' GOWORK='' CGO_CFLAGS='-O2 -g' CGO_CPPFLAGS='' CGO_CXXFLAGS='-O2 -g' CGO_FFLAGS='-O2 -g' CGO_LDFLAGS='-O2 -g' PKG_CONFIG='pkg-config' GOGCCFLAGS='-fPIC -arch arm64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -ffile-prefix-map=/var/folders/66/k0pykk6940x26kf_8jr90jn40000gn/T/go-build573054670=/tmp/go-build -gno-record-gcc-switches -fno-common' ```

Verbose output of running

```console $ golangci-lint cache clean $ golangci-lint run -v INFO [config_reader] Config search paths: [./ /Users/rich/code/toolbox /Users/rich/code /Users/rich /Users /] WARN [config_reader] The configuration option `linters.errcheck.ignore` is deprecated, please use `linters.errcheck.exclude-functions`. INFO [lintersdb] Active 6 linters: [errcheck gosimple govet ineffassign staticcheck unused] INFO [loader] Go packages loading at mode 575 (name|types_sizes|deps|exports_file|files|imports|compiled_files) took 887.619333ms INFO [runner/filename_unadjuster] Pre-built 0 adjustments in 5.858125ms INFO [linters_context/goanalysis] analyzers took 9.038843117s with top 10 stages: buildir: 4.758947918s, inspect: 252.762423ms, fact_deprecated: 199.924416ms, printf: 198.937293ms, ctrlflow: 148.076118ms, S1038: 142.413377ms, fact_purity: 139.084537ms, nilness: 125.260052ms, unused: 112.132717ms, SA5012: 110.878336ms INFO [runner/max_same_issues] 161/164 issues with text "composites: github.com/richardwilkes/toolbox/xmath/geom.Point[T] struct literal uses unkeyed fields" were hidden, use --max-same-issues INFO [runner] Issues before processing: 1350, after processing: 3 INFO [runner] Processors filtering stat (out/in): fixer: 3/3, path_prefixer: 3/3, cgo: 1350/1350, autogenerated_exclude: 1350/1350, exclude: 1350/1350, uniq_by_line: 164/1350, max_from_linter: 3/3, path_shortener: 3/3, sort_results: 3/3, path_prettifier: 1350/1350, identifier_marker: 1350/1350, exclude-rules: 1350/1350, diff: 164/164, max_per_file_from_linter: 164/164, max_same_issues: 3/164, invalid_issue: 1350/1350, skip_dirs: 1350/1350, nolint: 1350/1350, filename_unadjuster: 1350/1350, skip_files: 1350/1350, source_code: 3/3, severity-rules: 3/3 INFO [runner] processing took 58.708879ms with stages: exclude-rules: 39.812417ms, identifier_marker: 16.801041ms, nolint: 1.277126ms, path_prettifier: 368.167µs, skip_dirs: 100.042µs, invalid_issue: 67.292µs, autogenerated_exclude: 67.251µs, source_code: 65.834µs, uniq_by_line: 36.5µs, cgo: 35.958µs, filename_unadjuster: 34.833µs, max_same_issues: 34.125µs, max_per_file_from_linter: 3.958µs, max_from_linter: 1.709µs, path_shortener: 1.208µs, fixer: 292ns, sort_results: 250ns, exclude: 250ns, diff: 249ns, skip_files: 209ns, path_prefixer: 84ns, severity-rules: 84ns INFO [runner] linters took 1.587551875s with stages: goanalysis_metalinter: 1.528752292s xmath/geom/poly/polygon_test.go:33:4: composites: github.com/richardwilkes/toolbox/xmath/geom.Point[T] struct literal uses unkeyed fields (govet) {{200, 20}, {300, 20}, {300, 120}, {200, 120}}, ^ xmath/geom/poly/polygon_test.go:34:4: composites: github.com/richardwilkes/toolbox/xmath/geom.Point[T] struct literal uses unkeyed fields (govet) {{250, 50}, {280, 50}, {280, 80}, {250, 80}}, ^ xmath/geom/poly/polygon_test.go:35:4: composites: github.com/richardwilkes/toolbox/xmath/geom.Point[T] struct literal uses unkeyed fields (govet) {{260, 60}, {290, 60}, {290, 90}, {260, 90}}, ^ INFO File cache stats: 1 entries of total size 35.5KiB INFO Memory: 26 samples, avg is 234.8MB, max is 486.8MB INFO Execution took 2.486998583s ```

A minimal reproducible example or link to a public repository

```go https://github.com/richardwilkes/toolbox ```

Validation

boring-cyborg[bot] commented 1 month ago

Hey, thank you for opening your first Issue ! 🙂 If you would like to contribute we have a guide for contributors.

fgimian commented 1 month ago

Confirmed here also 😄

pulzarraider commented 1 month ago

Temporary fix to avoid the warning:

.golangci.yaml:

linters-settings:
  errcheck:
    ignore: ''

The default value for ignore option is fmt:.* so we have to reset it.

ldez commented 1 month ago

duplicate of #4733