Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat/upgrade-wrapcheck-config #2678

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions .golangci.example.yml
Expand Up @@ -1530,6 +1530,8 @@ linters-settings:
ignorePackageGlobs:
- encoding/*
- github.com/pkg/*
ignoreInterfaceRegexps:
- ^(?i)c(?-i)ach(ing|e)

wsl:
# See https://github.com/bombsimon/wsl/blob/master/doc/configuration.md for documentation of available settings.
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Expand Up @@ -85,7 +85,7 @@ require (
github.com/tdakkota/asciicheck v0.1.1
github.com/tetafro/godot v1.4.11
github.com/timakin/bodyclose v0.0.0-20210704033933-f49887972144
github.com/tomarrell/wrapcheck/v2 v2.5.0
github.com/tomarrell/wrapcheck/v2 v2.6.0
github.com/tommy-muehle/go-mnd/v2 v2.5.0
github.com/ultraware/funlen v0.0.3
github.com/ultraware/whitespace v0.0.5
Expand Down
2 changes: 2 additions & 0 deletions go.sum

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 4 additions & 3 deletions pkg/config/linters_settings.go
Expand Up @@ -591,9 +591,10 @@ type WhitespaceSettings struct {
}

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

type WSLSettings struct {
Expand Down
3 changes: 3 additions & 0 deletions pkg/golinters/wrapcheck.go
Expand Up @@ -19,6 +19,9 @@ func NewWrapcheck(settings *config.WrapcheckSettings) *goanalysis.Linter {
if len(settings.IgnoreSigRegexps) != 0 {
cfg.IgnoreSigRegexps = settings.IgnoreSigRegexps
}
if len(settings.IgnoreInterfaceRegexps) != 0 {
cfg.IgnoreInterfaceRegexps = settings.IgnoreInterfaceRegexps
}
if len(settings.IgnorePackageGlobs) != 0 {
cfg.IgnorePackageGlobs = settings.IgnorePackageGlobs
}
Expand Down