From 14c383c738f659a446985c0d2913a7752b2583e8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 17 Nov 2024 11:24:31 +0000 Subject: [PATCH 1/3] build(deps): bump github.com/tomarrell/wrapcheck/v2 from 2.9.0 to 2.10.0 Bumps [github.com/tomarrell/wrapcheck/v2](https://github.com/tomarrell/wrapcheck) from 2.9.0 to 2.10.0. - [Release notes](https://github.com/tomarrell/wrapcheck/releases) - [Commits](https://github.com/tomarrell/wrapcheck/compare/v2.9.0...v2.10.0) --- updated-dependencies: - dependency-name: github.com/tomarrell/wrapcheck/v2 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index ac093fed7f38..d261ad2b6e07 100644 --- a/go.mod +++ b/go.mod @@ -111,7 +111,7 @@ require ( github.com/tetafro/godot v1.4.18 github.com/timakin/bodyclose v0.0.0-20230421092635-574207250966 github.com/timonwong/loggercheck v0.10.1 - github.com/tomarrell/wrapcheck/v2 v2.9.0 + github.com/tomarrell/wrapcheck/v2 v2.10.0 github.com/tommy-muehle/go-mnd/v2 v2.5.1 github.com/ultraware/funlen v0.1.0 github.com/ultraware/whitespace v0.1.1 diff --git a/go.sum b/go.sum index 1c3b9f5d731e..5e47ac91bde5 100644 --- a/go.sum +++ b/go.sum @@ -553,8 +553,8 @@ github.com/tklauser/go-sysconf v0.3.12 h1:0QaGUFOdQaIVdPgfITYzaTegZvdCjmYO52cSFA github.com/tklauser/go-sysconf v0.3.12/go.mod h1:Ho14jnntGE1fpdOqQEEaiKRpvIavV0hSfmBq8nJbHYI= github.com/tklauser/numcpus v0.6.1 h1:ng9scYS7az0Bk4OZLvrNXNSAO2Pxr1XXRAPyjhIx+Fk= github.com/tklauser/numcpus v0.6.1/go.mod h1:1XfjsgE2zo8GVw7POkMbHENHzVg3GzmoZ9fESEdAacY= -github.com/tomarrell/wrapcheck/v2 v2.9.0 h1:801U2YCAjLhdN8zhZ/7tdjB3EnAoRlJHt/s+9hijLQ4= -github.com/tomarrell/wrapcheck/v2 v2.9.0/go.mod h1:g9vNIyhb5/9TQgumxQyOEqDHsmGYcGsVMOx/xGkqdMo= +github.com/tomarrell/wrapcheck/v2 v2.10.0 h1:SzRCryzy4IrAH7bVGG4cK40tNUhmVmMDuJujy4XwYDg= +github.com/tomarrell/wrapcheck/v2 v2.10.0/go.mod h1:g9vNIyhb5/9TQgumxQyOEqDHsmGYcGsVMOx/xGkqdMo= github.com/tommy-muehle/go-mnd/v2 v2.5.1 h1:NowYhSdyE/1zwK9QCLeRb6USWdoif80Ie+v+yU8u1Zw= github.com/tommy-muehle/go-mnd/v2 v2.5.1/go.mod h1:WsUAkMJMYww6l/ufffCD3m+P7LEvr8TnZn9lwVDlgzw= github.com/ultraware/funlen v0.1.0 h1:BuqclbkY6pO+cvxoq7OsktIXZpgBSkYTQtmwhAK81vI= From d227a307c687b24021a7e8f3bb098b45a6aaa5c5 Mon Sep 17 00:00:00 2001 From: Fernandez Ludovic Date: Sun, 17 Nov 2024 13:46:09 +0100 Subject: [PATCH 2/3] chore: update implementation --- .golangci.next.reference.yml | 8 ++++++++ jsonschema/golangci.next.jsonschema.json | 11 +++++++++++ pkg/config/linters_settings.go | 1 + pkg/golinters/wrapcheck/wrapcheck.go | 2 ++ 4 files changed, 22 insertions(+) diff --git a/.golangci.next.reference.yml b/.golangci.next.reference.yml index c737eb16a3d9..8ece85424644 100644 --- a/.golangci.next.reference.yml +++ b/.golangci.next.reference.yml @@ -3584,6 +3584,14 @@ linters-settings: multi-func: true wrapcheck: + # An array of strings specifying additional substrings of signatures to ignore. + # Unlike 'ignoreSigs', this option extends the default set (or the set specified in 'ignoreSigs') without replacing it entirely. + # This allows you to add specific signatures to the ignore list + # while retaining the defaults or any items in 'ignoreSigs'. + extra-ignore-sigs: + - .CustomError( + - .SpecificWrap( + # An array of strings that specify substrings of signatures to ignore. # If this set, it will override the default set of ignored signatures. # See https://github.com/tomarrell/wrapcheck#configuration for more information. diff --git a/jsonschema/golangci.next.jsonschema.json b/jsonschema/golangci.next.jsonschema.json index 4048750fedf5..34ff55082963 100644 --- a/jsonschema/golangci.next.jsonschema.json +++ b/jsonschema/golangci.next.jsonschema.json @@ -3412,6 +3412,17 @@ "type": "object", "additionalProperties": false, "properties": { + "extra-ignore-sigs": { + "description": "An array of strings specifying additional substrings of signatures to ignore.", + "default": [ + ".CustomError(", + ".SpecificWrap(" + ], + "type": "array", + "items": { + "type": "string" + } + }, "ignoreSigs": { "description": "An array of strings which specify substrings of signatures to ignore.", "default": [ diff --git a/pkg/config/linters_settings.go b/pkg/config/linters_settings.go index b182d1e0f1b5..c7115e1aa8a5 100644 --- a/pkg/config/linters_settings.go +++ b/pkg/config/linters_settings.go @@ -982,6 +982,7 @@ type WhitespaceSettings struct { } type WrapcheckSettings struct { + ExtraIgnoreSigs []string `mapstructure:"extra-ignore-sigs"` // TODO(ldez): v2 the options must be renamed to use hyphen. IgnoreSigs []string `mapstructure:"ignoreSigs"` IgnoreSigRegexps []string `mapstructure:"ignoreSigRegexps"` diff --git a/pkg/golinters/wrapcheck/wrapcheck.go b/pkg/golinters/wrapcheck/wrapcheck.go index 96ec2eeae047..b2f5ec742098 100644 --- a/pkg/golinters/wrapcheck/wrapcheck.go +++ b/pkg/golinters/wrapcheck/wrapcheck.go @@ -11,6 +11,8 @@ import ( func New(settings *config.WrapcheckSettings) *goanalysis.Linter { cfg := wrapcheck.NewDefaultConfig() if settings != nil { + cfg.ExtraIgnoreSigs = settings.ExtraIgnoreSigs + if len(settings.IgnoreSigs) != 0 { cfg.IgnoreSigs = settings.IgnoreSigs } From 4a7dc7128c1d387b1e969ad65ce983967d00f88b Mon Sep 17 00:00:00 2001 From: Fernandez Ludovic Date: Mon, 18 Nov 2024 23:20:57 +0100 Subject: [PATCH 3/3] docs: add default --- .golangci.next.reference.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.golangci.next.reference.yml b/.golangci.next.reference.yml index 8ece85424644..2ba4050812a6 100644 --- a/.golangci.next.reference.yml +++ b/.golangci.next.reference.yml @@ -3588,6 +3588,7 @@ linters-settings: # Unlike 'ignoreSigs', this option extends the default set (or the set specified in 'ignoreSigs') without replacing it entirely. # This allows you to add specific signatures to the ignore list # while retaining the defaults or any items in 'ignoreSigs'. + # Default: [] extra-ignore-sigs: - .CustomError( - .SpecificWrap(