Skip to content

Commit 89367ae

Browse files
author
Denis Krivak
authored
Add "exclude" option for godot linter (#1669)
1 parent 5d75889 commit 89367ae

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

.golangci.example.yml

+5-1
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,10 @@ linters-settings:
193193
godot:
194194
# comments to be checked: `declarations`, `toplevel`, or `all`
195195
scope: declarations
196+
# list of regexps for excluding particular comment lines from check
197+
exclude:
198+
# example: exclude comments which contain numbers
199+
# - '[0-9]+'
196200
# check that each sentence starts with a capital letter
197201
capital: false
198202
godox:
@@ -294,7 +298,7 @@ linters-settings:
294298
# specify an error message to output when a blacklisted package is used
295299
- github.com/sirupsen/logrus: "logging is allowed only by logutils.Log"
296300
ifshort:
297-
# Maximum length of variable declaration measured in number of lines, after which linter won't suggest using short syntax.
301+
# Maximum length of variable declaration measured in number of lines, after which linter won't suggest using short syntax.
298302
# Has higher priority than max-decl-chars.
299303
max-decl-lines: 1
300304
# Maximum length of variable declaration measured in number of characters, after which linter won't suggest using short syntax.

pkg/config/config.go

+3-2
Original file line numberDiff line numberDiff line change
@@ -356,8 +356,9 @@ type WSLSettings struct {
356356
}
357357

358358
type GodotSettings struct {
359-
Scope string `mapstructure:"scope"`
360-
Capital bool `mapstructure:"capital"`
359+
Scope string `mapstructure:"scope"`
360+
Exclude []string `mapstructure:"exclude"`
361+
Capital bool `mapstructure:"capital"`
361362

362363
// Deprecated: use `Scope` instead
363364
CheckAll bool `mapstructure:"check-all"`

pkg/golinters/godot.go

+1
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ func NewGodot() *goanalysis.Linter {
3030
cfg := lintCtx.Cfg.LintersSettings.Godot
3131
settings := godot.Settings{
3232
Scope: godot.Scope(cfg.Scope),
33+
Exclude: cfg.Exclude,
3334
Period: true,
3435
Capital: cfg.Capital,
3536
}

0 commit comments

Comments
 (0)