Skip to content

Commit db019fd

Browse files
timkralSeigeC
authored andcommitted
wrapcheck: update configuration to include ignoreSignRegexps (golangci#2379)
1 parent 6b1a05f commit db019fd

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

.golangci.example.yml

+4-2
Original file line numberDiff line numberDiff line change
@@ -767,9 +767,11 @@ linters-settings:
767767
- .WithMessage(
768768
- .WithMessagef(
769769
- .WithStack(
770+
ignoreSigRegexps:
771+
- \.New.*Error\(
770772
ignorePackageGlobs:
771-
- encoding/*
772-
- github.com/pkg/*
773+
- encoding/*
774+
- github.com/pkg/*
773775

774776
wsl:
775777
# See https://github.com/bombsimon/wsl/blob/master/doc/configuration.md for

pkg/config/linters_settings.go

+1
Original file line numberDiff line numberDiff line change
@@ -525,6 +525,7 @@ type WhitespaceSettings struct {
525525

526526
type WrapcheckSettings struct {
527527
IgnoreSigs []string `mapstructure:"ignoreSigs"`
528+
IgnoreSigRegexps []string `mapstructure:"ignoreSigRegexps"`
528529
IgnorePackageGlobs []string `mapstructure:"ignorePackageGlobs"`
529530
}
530531

pkg/golinters/wrapcheck.go

+3
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ func NewWrapcheck(settings *config.WrapcheckSettings) *goanalysis.Linter {
1616
if len(settings.IgnoreSigs) != 0 {
1717
cfg.IgnoreSigs = settings.IgnoreSigs
1818
}
19+
if len(settings.IgnoreSigRegexps) != 0 {
20+
cfg.IgnoreSigRegexps = settings.IgnoreSigRegexps
21+
}
1922
if len(settings.IgnorePackageGlobs) != 0 {
2023
cfg.IgnorePackageGlobs = settings.IgnorePackageGlobs
2124
}

0 commit comments

Comments
 (0)