Skip to content

Commit d227a30

Browse files
committed
chore: update implementation
1 parent 14c383c commit d227a30

File tree

4 files changed

+22
-0
lines changed

4 files changed

+22
-0
lines changed

.golangci.next.reference.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3584,6 +3584,14 @@ linters-settings:
35843584
multi-func: true
35853585

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

jsonschema/golangci.next.jsonschema.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3412,6 +3412,17 @@
34123412
"type": "object",
34133413
"additionalProperties": false,
34143414
"properties": {
3415+
"extra-ignore-sigs": {
3416+
"description": "An array of strings specifying additional substrings of signatures to ignore.",
3417+
"default": [
3418+
".CustomError(",
3419+
".SpecificWrap("
3420+
],
3421+
"type": "array",
3422+
"items": {
3423+
"type": "string"
3424+
}
3425+
},
34153426
"ignoreSigs": {
34163427
"description": "An array of strings which specify substrings of signatures to ignore.",
34173428
"default": [

pkg/config/linters_settings.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -982,6 +982,7 @@ type WhitespaceSettings struct {
982982
}
983983

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

pkg/golinters/wrapcheck/wrapcheck.go

Lines changed: 2 additions & 0 deletions
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)