Skip to content

Commit

Permalink
chore: update implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
ldez committed Nov 17, 2024
1 parent 14c383c commit d227a30
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 0 deletions.
8 changes: 8 additions & 0 deletions .golangci.next.reference.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
11 changes: 11 additions & 0 deletions jsonschema/golangci.next.jsonschema.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": [
Expand Down
1 change: 1 addition & 0 deletions pkg/config/linters_settings.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
Expand Down
2 changes: 2 additions & 0 deletions pkg/golinters/wrapcheck/wrapcheck.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit d227a30

Please sign in to comment.