diff --git a/.golangci.example.yml b/.golangci.example.yml index 6e0bfeabc5df..ac0577c6ad7a 100644 --- a/.golangci.example.yml +++ b/.golangci.example.yml @@ -616,6 +616,11 @@ linters-settings: - .Wrap( - .Wrapf( - .WithMessage( + - .WithMessagef( + - .WithStack( + ignorePackageGlobs: + - encoding/* + - github.com/pkg/* wsl: # See https://github.com/bombsimon/wsl/blob/master/doc/configuration.md for diff --git a/go.mod b/go.mod index 8464b04f0b79..bae5becedd20 100644 --- a/go.mod +++ b/go.mod @@ -77,7 +77,7 @@ require ( github.com/tdakkota/asciicheck v0.0.0-20200416200610-e657995f937b github.com/tetafro/godot v1.4.8 github.com/timakin/bodyclose v0.0.0-20200424151742-cb6215831a94 - github.com/tomarrell/wrapcheck/v2 v2.2.0 + github.com/tomarrell/wrapcheck/v2 v2.3.0 github.com/tommy-muehle/go-mnd/v2 v2.4.0 github.com/ultraware/funlen v0.0.3 github.com/ultraware/whitespace v0.0.4 diff --git a/go.sum b/go.sum index 52dbd913b4bd..5c379e342817 100644 --- a/go.sum +++ b/go.sum @@ -691,8 +691,8 @@ github.com/tklauser/numcpus v0.2.2/go.mod h1:x3qojaO3uyYt0i56EW/VUYs7uBvdl2fkfZF github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= github.com/tmc/grpc-websocket-proxy v0.0.0-20200427203606-3cfed13b9966/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= -github.com/tomarrell/wrapcheck/v2 v2.2.0 h1:49M2upxGd1vxpwTv0NYdUpqZrpM4nt4i+BN61MuyPVw= -github.com/tomarrell/wrapcheck/v2 v2.2.0/go.mod h1:crK5eI4RGSUrb9duDTQ5GqcukbKZvi85vX6nbhsBAeI= +github.com/tomarrell/wrapcheck/v2 v2.3.0 h1:i3DNjtyyL1xwaBQOsPPk8LAcpayWfQv2rxNi9b/eEx4= +github.com/tomarrell/wrapcheck/v2 v2.3.0/go.mod h1:aF5rnkdtqNWP/gC7vPUO5pKsB0Oac2FDTQP4F+dpZMU= github.com/tomasen/realip v0.0.0-20180522021738-f0c99a92ddce/go.mod h1:o8v6yHRoik09Xen7gje4m9ERNah1d1PPsVq1VEx9vE4= github.com/tommy-muehle/go-mnd/v2 v2.4.0 h1:1t0f8Uiaq+fqKteUR4N9Umr6E99R+lDnLnq7PwX2PPE= github.com/tommy-muehle/go-mnd/v2 v2.4.0/go.mod h1:WsUAkMJMYww6l/ufffCD3m+P7LEvr8TnZn9lwVDlgzw= diff --git a/pkg/config/linters_settings.go b/pkg/config/linters_settings.go index b65c19c44d42..fd5f413181ca 100644 --- a/pkg/config/linters_settings.go +++ b/pkg/config/linters_settings.go @@ -462,7 +462,8 @@ type WhitespaceSettings struct { } type WrapcheckSettings struct { - IgnoreSigs []string `mapstructure:"ignoreSigs"` + IgnoreSigs []string `mapstructure:"ignoreSigs"` + IgnorePackageGlobs []string `mapstructure:"ignorePackageGlobs"` } type WSLSettings struct { diff --git a/pkg/golinters/wrapcheck.go b/pkg/golinters/wrapcheck.go index 7717d188ac67..5eaf085d7435 100644 --- a/pkg/golinters/wrapcheck.go +++ b/pkg/golinters/wrapcheck.go @@ -16,6 +16,9 @@ func NewWrapcheck(settings *config.WrapcheckSettings) *goanalysis.Linter { if len(settings.IgnoreSigs) != 0 { cfg.IgnoreSigs = settings.IgnoreSigs } + if len(settings.IgnorePackageGlobs) != 0 { + cfg.IgnorePackageGlobs = settings.IgnorePackageGlobs + } } a := wrapcheck.NewAnalyzer(cfg)