deps: Update Wrapcheck to v2.3.0 (#2145)

* Update Wrapcheck to v2.3

Updat ignoreSigs default, add ignorePackageGlobs

* Update .golangci.example.yml

Co-authored-by: Ludovic Fernandez <ldez@users.noreply.github.com>

Co-authored-by: Ludovic Fernandez <ldez@users.noreply.github.com>
This commit is contained in:
hn8 2021-08-02 20:17:39 +08:00 committed by GitHub
parent 54bfadb395
commit 6c295e4042
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 13 additions and 4 deletions

View File

@ -616,6 +616,11 @@ linters-settings:
- .Wrap( - .Wrap(
- .Wrapf( - .Wrapf(
- .WithMessage( - .WithMessage(
- .WithMessagef(
- .WithStack(
ignorePackageGlobs:
- encoding/*
- github.com/pkg/*
wsl: wsl:
# See https://github.com/bombsimon/wsl/blob/master/doc/configuration.md for # See https://github.com/bombsimon/wsl/blob/master/doc/configuration.md for

2
go.mod
View File

@ -77,7 +77,7 @@ require (
github.com/tdakkota/asciicheck v0.0.0-20200416200610-e657995f937b github.com/tdakkota/asciicheck v0.0.0-20200416200610-e657995f937b
github.com/tetafro/godot v1.4.8 github.com/tetafro/godot v1.4.8
github.com/timakin/bodyclose v0.0.0-20200424151742-cb6215831a94 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/tommy-muehle/go-mnd/v2 v2.4.0
github.com/ultraware/funlen v0.0.3 github.com/ultraware/funlen v0.0.3
github.com/ultraware/whitespace v0.0.4 github.com/ultraware/whitespace v0.0.4

4
go.sum generated
View File

@ -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-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-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/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.3.0 h1:i3DNjtyyL1xwaBQOsPPk8LAcpayWfQv2rxNi9b/eEx4=
github.com/tomarrell/wrapcheck/v2 v2.2.0/go.mod h1:crK5eI4RGSUrb9duDTQ5GqcukbKZvi85vX6nbhsBAeI= 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/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 h1:1t0f8Uiaq+fqKteUR4N9Umr6E99R+lDnLnq7PwX2PPE=
github.com/tommy-muehle/go-mnd/v2 v2.4.0/go.mod h1:WsUAkMJMYww6l/ufffCD3m+P7LEvr8TnZn9lwVDlgzw= github.com/tommy-muehle/go-mnd/v2 v2.4.0/go.mod h1:WsUAkMJMYww6l/ufffCD3m+P7LEvr8TnZn9lwVDlgzw=

View File

@ -462,7 +462,8 @@ type WhitespaceSettings struct {
} }
type WrapcheckSettings struct { type WrapcheckSettings struct {
IgnoreSigs []string `mapstructure:"ignoreSigs"` IgnoreSigs []string `mapstructure:"ignoreSigs"`
IgnorePackageGlobs []string `mapstructure:"ignorePackageGlobs"`
} }
type WSLSettings struct { type WSLSettings struct {

View File

@ -16,6 +16,9 @@ func NewWrapcheck(settings *config.WrapcheckSettings) *goanalysis.Linter {
if len(settings.IgnoreSigs) != 0 { if len(settings.IgnoreSigs) != 0 {
cfg.IgnoreSigs = settings.IgnoreSigs cfg.IgnoreSigs = settings.IgnoreSigs
} }
if len(settings.IgnorePackageGlobs) != 0 {
cfg.IgnorePackageGlobs = settings.IgnorePackageGlobs
}
} }
a := wrapcheck.NewAnalyzer(cfg) a := wrapcheck.NewAnalyzer(cfg)