Skip to content
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

errcheck: no option to skip default excludes #2606

Closed
4 tasks done
mislav opened this issue Feb 21, 2022 · 2 comments · Fixed by #2607
Closed
4 tasks done

errcheck: no option to skip default excludes #2606

mislav opened this issue Feb 21, 2022 · 2 comments · Fixed by #2607
Labels
bug Something isn't working

Comments

@mislav
Copy link

mislav commented Feb 21, 2022

Welcome

  • 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

The upgrade of errcheck in #1319 resulted in a regression where there is no option to use the .golangci.yml config file to skip the default errcheck excludes.

The default errcheck excludes are imported in this line:

Symbols: append([]string{}, errcheck.DefaultExcludedSymbols...),

From this point onward, golangci config file can only append to the Symbols slice, but not remove from it. The errcheck standalone tool has an option to skip these excludes with its flag errcheck --excludeonly, but the golangci tool does not have an equivalent.

Expectation: linters-settings.errcheck.* options from the golangci config file should include a way to skip the default errcheck excludes, allowing errcheck to report all violations found instead of just a subset of them.

Version of golangci-lint

$ golangci-lint --version
golangci-lint has version v1.42.1 built from (unknown, mod sum: "h1:nC4WyrbdnNdohDVUoNKjy/4N4FTM1gCFaVeXecy6vzM=") on (unknown)

Configuration file

$ cat .golangci.yml
issues:
  exclude-use-default: false

Go environment

$ go version && go env
go version go1.17 darwin/amd64
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/mislav/Library/Caches/go-build"
GOENV="/Users/mislav/Library/Application Support/go/env"
GOEXE=""
GOEXPERIMENT=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOINSECURE=""
GOMODCACHE="/Users/mislav/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="darwin"
GOPATH="/Users/mislav/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/Cellar/go/1.17/libexec"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/Cellar/go/1.17/libexec/pkg/tool/darwin_amd64"
GOVCS=""
GOVERSION="go1.17"
GCCGO="gccgo"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/Users/mislav/p/survey/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 -arch x86_64 -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/83/1fmp_ys94j15w9q32g20d2kr0000gn/T/go-build3827898059=/tmp/go-build -gno-record-gcc-switches -fno-common"

Verbose output of running

$ golangci-lint cache clean
$ golangci-lint run -v

Code example or link to a public repository

n/a

@mislav mislav added the bug Something isn't working label Feb 21, 2022
@boring-cyborg
Copy link

boring-cyborg bot commented Feb 21, 2022

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

@mislav
Copy link
Author

mislav commented Feb 21, 2022

Wow, thanks for the fast fix and merge!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant