Skip to content

Add "exclude" option for godot linter #1669

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

Merged
merged 1 commit into from
Jan 29, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion .golangci.example.yml
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,10 @@ linters-settings:
godot:
# comments to be checked: `declarations`, `toplevel`, or `all`
scope: declarations
# list of regexps for excluding particular comment lines from check
exclude:
# example: exclude comments which contain numbers
# - '[0-9]+'
# check that each sentence starts with a capital letter
capital: false
godox:
Expand Down Expand Up @@ -294,7 +298,7 @@ linters-settings:
# specify an error message to output when a blacklisted package is used
- github.com/sirupsen/logrus: "logging is allowed only by logutils.Log"
ifshort:
# Maximum length of variable declaration measured in number of lines, after which linter won't suggest using short syntax.
# Maximum length of variable declaration measured in number of lines, after which linter won't suggest using short syntax.
# Has higher priority than max-decl-chars.
max-decl-lines: 1
# Maximum length of variable declaration measured in number of characters, after which linter won't suggest using short syntax.
Expand Down
5 changes: 3 additions & 2 deletions pkg/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -356,8 +356,9 @@ type WSLSettings struct {
}

type GodotSettings struct {
Scope string `mapstructure:"scope"`
Capital bool `mapstructure:"capital"`
Scope string `mapstructure:"scope"`
Exclude []string `mapstructure:"exclude"`
Capital bool `mapstructure:"capital"`

// Deprecated: use `Scope` instead
CheckAll bool `mapstructure:"check-all"`
Expand Down
1 change: 1 addition & 0 deletions pkg/golinters/godot.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ func NewGodot() *goanalysis.Linter {
cfg := lintCtx.Cfg.LintersSettings.Godot
settings := godot.Settings{
Scope: godot.Scope(cfg.Scope),
Exclude: cfg.Exclude,
Period: true,
Capital: cfg.Capital,
}
Expand Down