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

wrapcheck ignoreSigs config not being applied #1954

Closed
4 tasks done
carldunham opened this issue May 4, 2021 · 2 comments
Closed
4 tasks done

wrapcheck ignoreSigs config not being applied #1954

carldunham opened this issue May 4, 2021 · 2 comments
Labels
question Further information is requested

Comments

@carldunham
Copy link

  • 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

Have set list of strings in linters-settings.wrapcheck.ignoreSigs in .golangci.yml that include the default set plus one more, but the added one isn't being respected.

When adding the same list to .wrapcheck.yaml, wrapcheck honors the new list when run standalone, but not with golangci-lint.

Version of golangci-lint
$ golangci-lint --version
golangci-lint has version 1.39.0 built from 9aea4aee on 2021-03-26T08:02:53Z
Config file
$ cat .golangci.yml
linters:
  disable-all: true
  enable: wrapcheck

linters-settings:
  wrapcheck:
    ignoreSigs:
      - .Errorf(
      - errors.New(
      - errors.Unwrap(
      - .Wrap(
      - .Wrapf(
      - .WithMessage(
      - ed25519.GenerateKey(
Go environment
$ go version && go env
go version go1.16.3 darwin/amd64
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/cdunham/Library/Caches/go-build"
GOENV="/Users/cdunham/Library/Application Support/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOINSECURE=""
GOMODCACHE="/Users/cdunham/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="darwin"
GOPATH="/Users/cdunham/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/Cellar/go/1.16.3/libexec"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/Cellar/go/1.16.3/libexec/pkg/tool/darwin_amd64"
GOVCS=""
GOVERSION="go1.16.3"
GCCGO="gccgo"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/Users/cdunham/Projects/carldunham/acme/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/n4/b8gtfcz17yl3qtpf4zz0mv_w0000gn/T/go-build2762804261=/tmp/go-build -gno-record-gcc-switches -fno-common"
</details>

<details><summary>Verbose output of running</summary>

```console
$ golangci-lint cache clean
$ golangci-lint run -v
INFO [config_reader] Config search paths: [./ /Users/cdunham/Projects/carldunham/acme /Users/cdunham/Projects/carldunham /Users/cdunham/Projects /Users/cdunham /Users /] 
INFO [config_reader] Used config file .golangci.yml 
INFO [lintersdb] Active 1 linters: [wrapcheck]    
INFO [loader] Go packages loading at mode 575 (types_sizes|compiled_files|deps|imports|name|exports_file|files) took 609.379962ms 
INFO [runner/filename_unadjuster] Pre-built 0 adjustments in 2.676939ms 
INFO [linters context/goanalysis] analyzers took 486.947µs with top 10 stages: wrapcheck: 486.947µs 
INFO [runner] Processors filtering stat (out/in): cgo: 1/1, identifier_marker: 1/1, nolint: 1/1, max_same_issues: 1/1, path_shortener: 1/1, source_code: 1/1, skip_files: 1/1, autogenerated_exclude: 1/1, uniq_by_line: 1/1, diff: 1/1, exclude-rules: 1/1, max_per_file_from_linter: 1/1, max_from_linter: 1/1, severity-rules: 1/1, filename_unadjuster: 1/1, path_prettifier: 1/1, skip_dirs: 1/1, exclude: 1/1, path_prefixer: 1/1, sort_results: 1/1 
INFO [runner] processing took 1.459756ms with stages: identifier_marker: 644.912µs, autogenerated_exclude: 331.513µs, source_code: 258.543µs, nolint: 100.266µs, path_prettifier: 52.147µs, exclude-rules: 34.035µs, skip_dirs: 13.252µs, max_same_issues: 10.864µs, cgo: 4.155µs, uniq_by_line: 3.886µs, path_shortener: 1.79µs, max_from_linter: 922ns, filename_unadjuster: 830ns, max_per_file_from_linter: 746ns, sort_results: 422ns, exclude: 401ns, skip_files: 336ns, severity-rules: 318ns, diff: 279ns, path_prefixer: 139ns 
INFO [runner] linters took 577.466742ms with stages: wrapcheck: 575.757275ms 
main.go:12:9: error returned from external package is unwrapped (wrapcheck)
        return ed25519.GenerateKey(nil)
               ^
INFO File cache stats: 1 entries of total size 191B 
INFO Memory: 14 samples, avg is 100.5MB, max is 138.4MB 
INFO Execution took 1.240977246s                 
Code example or link to a public repository
package main

import "crypto/ed25519"

func main() {
	if _, _, err := run(); err != nil {
		panic(err)
	}
}

func run() (interface{}, interface{}, error) {
	return ed25519.GenerateKey(nil)
}
@carldunham carldunham added the bug Something isn't working label May 4, 2021
@boring-cyborg
Copy link

boring-cyborg bot commented May 4, 2021

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

@ldez
Copy link
Member

ldez commented May 4, 2021

Hello,

the configuration of wrapcheck is related to the v2: #1947

It will be a part of the next release (v1.40.0)

@ldez ldez closed this as completed May 4, 2021
@ldez ldez added question Further information is requested and removed bug Something isn't working labels May 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants