Skip to content

Commit 3a0bcea

Browse files
committed
chore: rename misspell option
1 parent e651eee commit 3a0bcea

File tree

7 files changed

+12
-13
lines changed

7 files changed

+12
-13
lines changed

.golangci.next.reference.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2215,7 +2215,7 @@ linters-settings:
22152215
# Typos to ignore.
22162216
# Should be in lower case.
22172217
# Default: []
2218-
ignore-words:
2218+
ignore-rules:
22192219
- someword
22202220
# Extra word corrections.
22212221
# `typo` and `correction` should only contain letters.

.golangci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ linters-settings:
187187
line-length: 140
188188
misspell:
189189
locale: US
190-
ignore-words:
190+
ignore-rules:
191191
- "importas" # linter name
192192
nolintlint:
193193
allow-unused: false # report any unused nolint directives

jsonschema/golangci.next.jsonschema.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2135,8 +2135,8 @@
21352135
"locale": {
21362136
"enum": ["US", "UK"]
21372137
},
2138-
"ignore-words": {
2139-
"description": "List of words to ignore.",
2138+
"ignore-rules": {
2139+
"description": "List of rules to ignore.",
21402140
"type": "array",
21412141
"items": {
21422142
"type": "string"

pkg/config/linters_settings.go

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -673,11 +673,10 @@ type MakezeroSettings struct {
673673
}
674674

675675
type MisspellSettings struct {
676-
Mode string `mapstructure:"mode"`
677-
Locale string `mapstructure:"locale"`
678-
ExtraWords []MisspellExtraWords `mapstructure:"extra-words"`
679-
// TODO(ldez): v2 the option must be renamed to `IgnoredRules`.
680-
IgnoreWords []string `mapstructure:"ignore-words"`
676+
Mode string `mapstructure:"mode"`
677+
Locale string `mapstructure:"locale"`
678+
ExtraWords []MisspellExtraWords `mapstructure:"extra-words"`
679+
IgnoreRules []string `mapstructure:"ignore-rules"`
681680
}
682681

683682
type MisspellExtraWords struct {

pkg/golinters/misspell/misspell.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,8 @@ func createMisspellReplacer(settings *config.MisspellSettings) (*misspell.Replac
6868
return nil, fmt.Errorf("process extra words: %w", err)
6969
}
7070

71-
if len(settings.IgnoreWords) != 0 {
72-
replacer.RemoveRule(settings.IgnoreWords)
71+
if len(settings.IgnoreRules) != 0 {
72+
replacer.RemoveRule(settings.IgnoreRules)
7373
}
7474

7575
// It can panic.

pkg/golinters/misspell/testdata/misspell.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@ version: "2"
33
linters-settings:
44
misspell:
55
locale: US
6-
ignore-words:
6+
ignore-rules:
77
- langauge
88
- Dialogue

test/testdata/configs/output.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ version: "2"
33
linters-settings:
44
misspell:
55
locale: US
6-
ignore-words:
6+
ignore-rules:
77
- langauge
88
- Dialogue
99

0 commit comments

Comments
 (0)