wrapcheck: update configuration to include ignoreSignRegexps (#2379)

This commit is contained in:
Tim Kral 2021-11-26 14:26:31 -08:00 committed by GitHub
parent 55358972d6
commit a5f0a4d861
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 2 deletions

View File

@ -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

View File

@ -525,6 +525,7 @@ type WhitespaceSettings struct {
type WrapcheckSettings struct {
IgnoreSigs []string `mapstructure:"ignoreSigs"`
IgnoreSigRegexps []string `mapstructure:"ignoreSigRegexps"`
IgnorePackageGlobs []string `mapstructure:"ignorePackageGlobs"`
}

View File

@ -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
}