Skip to content

Commit 842bee3

Browse files
committed
chore: update implementation
1 parent 0d04f11 commit 842bee3

File tree

4 files changed

+22
-0
lines changed

4 files changed

+22
-0
lines changed

.golangci.next.reference.yml

+8
Original file line numberDiff line numberDiff line change
@@ -3587,6 +3587,14 @@ linters-settings:
35873587
multi-func: true
35883588

35893589
wrapcheck:
3590+
# An array of strings specifying additional substrings of signatures to ignore.
3591+
# Unlike 'ignoreSigs', this option extends the default set (or the set specified in 'ignoreSigs') without replacing it entirely.
3592+
# This allows you to add specific signatures to the ignore list
3593+
# while retaining the defaults or any items in 'ignoreSigs'.
3594+
extra-ignore-sigs:
3595+
- .CustomError(
3596+
- .SpecificWrap(
3597+
35903598
# An array of strings that specify substrings of signatures to ignore.
35913599
# If this set, it will override the default set of ignored signatures.
35923600
# See https://github.com/tomarrell/wrapcheck#configuration for more information.

jsonschema/golangci.next.jsonschema.json

+11
Original file line numberDiff line numberDiff line change
@@ -3417,6 +3417,17 @@
34173417
"type": "object",
34183418
"additionalProperties": false,
34193419
"properties": {
3420+
"extra-ignore-sigs": {
3421+
"description": "An array of strings specifying additional substrings of signatures to ignore.",
3422+
"default": [
3423+
".CustomError(",
3424+
".SpecificWrap("
3425+
],
3426+
"type": "array",
3427+
"items": {
3428+
"type": "string"
3429+
}
3430+
},
34203431
"ignoreSigs": {
34213432
"description": "An array of strings which specify substrings of signatures to ignore.",
34223433
"default": [

pkg/config/linters_settings.go

+1
Original file line numberDiff line numberDiff line change
@@ -984,6 +984,7 @@ type WhitespaceSettings struct {
984984
}
985985

986986
type WrapcheckSettings struct {
987+
ExtraIgnoreSigs []string `mapstructure:"extra-ignore-sigs"`
987988
// TODO(ldez): v2 the options must be renamed to use hyphen.
988989
IgnoreSigs []string `mapstructure:"ignoreSigs"`
989990
IgnoreSigRegexps []string `mapstructure:"ignoreSigRegexps"`

pkg/golinters/wrapcheck/wrapcheck.go

+2
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ import (
1111
func New(settings *config.WrapcheckSettings) *goanalysis.Linter {
1212
cfg := wrapcheck.NewDefaultConfig()
1313
if settings != nil {
14+
cfg.ExtraIgnoreSigs = settings.ExtraIgnoreSigs
15+
1416
if len(settings.IgnoreSigs) != 0 {
1517
cfg.IgnoreSigs = settings.IgnoreSigs
1618
}

0 commit comments

Comments
 (0)