From 6c295e404247459f9b5e0f50c587f60e2f467ac1 Mon Sep 17 00:00:00 2001 From: hn8 <10730886+hn8@users.noreply.github.com> Date: Mon, 2 Aug 2021 20:17:39 +0800 Subject: [PATCH] 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 Co-authored-by: Ludovic Fernandez --- .golangci.example.yml | 5 +++++ go.mod | 2 +- go.sum | 4 ++-- pkg/config/linters_settings.go | 3 ++- pkg/golinters/wrapcheck.go | 3 +++ 5 files changed, 13 insertions(+), 4 deletions(-) diff --git a/.golangci.example.yml b/.golangci.example.yml index 6e0bfeab..ac0577c6 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 8464b04f..bae5bece 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 52dbd913..5c379e34 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 b65c19c4..fd5f4131 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 7717d188..5eaf085d 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)