Skip to content

Commit

Permalink
wrapcheck: update configuration to include ignoreSignRegexps (#2379)
Browse files Browse the repository at this point in the history
  • Loading branch information
timkral authored Nov 26, 2021
1 parent 5535897 commit a5f0a4d
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
6 changes: 4 additions & 2 deletions .golangci.example.yml
Original file line number Diff line number Diff line change
Expand Up @@ -762,9 +762,11 @@ linters-settings:
- .WithMessage(
- .WithMessagef(
- .WithStack(
ignoreSigRegexps:
- \.New.*Error\(
ignorePackageGlobs:
- encoding/*
- github.com/pkg/*
- encoding/*
- github.com/pkg/*

wsl:
# See https://github.com/bombsimon/wsl/blob/master/doc/configuration.md for
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 @@ -525,6 +525,7 @@ type WhitespaceSettings struct {

type WrapcheckSettings struct {
IgnoreSigs []string `mapstructure:"ignoreSigs"`
IgnoreSigRegexps []string `mapstructure:"ignoreSigRegexps"`
IgnorePackageGlobs []string `mapstructure:"ignorePackageGlobs"`
}

Expand Down
3 changes: 3 additions & 0 deletions pkg/golinters/wrapcheck.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ func NewWrapcheck(settings *config.WrapcheckSettings) *goanalysis.Linter {
if len(settings.IgnoreSigs) != 0 {
cfg.IgnoreSigs = settings.IgnoreSigs
}
if len(settings.IgnoreSigRegexps) != 0 {
cfg.IgnoreSigRegexps = settings.IgnoreSigRegexps
}
if len(settings.IgnorePackageGlobs) != 0 {
cfg.IgnorePackageGlobs = settings.IgnorePackageGlobs
}
Expand Down

0 comments on commit a5f0a4d

Please sign in to comment.