Skip to content

Commit

Permalink
wrapcheck: update configuration to include ignoreSignRegexps (golangc…
Browse files Browse the repository at this point in the history
  • Loading branch information
timkral authored and SeigeC committed Apr 4, 2023
1 parent 6b1a05f commit db019fd
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
Expand Up @@ -767,9 +767,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
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
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 db019fd

Please sign in to comment.