Skip to content

build(deps): bump github.com/golangci/misspell 0.4.0 to 0.4.1 #3918

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 3 commits into from
Jun 19, 2023
Merged
Show file tree
Hide file tree
Changes from 2 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
3 changes: 2 additions & 1 deletion pkg/config/linters_settings.go
Original file line number Diff line number Diff line change
Expand Up @@ -609,7 +609,8 @@ type MalignedSettings struct {
}

type MisspellSettings struct {
Locale string
Locale string
// TODO(ldez): v2 the options must be renamed to `IgnoredRules`.
IgnoreWords []string `mapstructure:"ignore-words"`
}

Expand Down
6 changes: 5 additions & 1 deletion pkg/golinters/misspell.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,11 @@ func createMisspellReplacer(settings *config.MisspellSettings) (*misspell.Replac
}

if len(settings.IgnoreWords) != 0 {
replacer.RemoveRule(settings.IgnoreWords)
var ignoredRules []string
for _, word := range settings.IgnoreWords {
ignoredRules = append(ignoredRules, strings.ToLower(word))
}
replacer.RemoveRule(ignoredRules)
}

// It can panic.
Expand Down
2 changes: 2 additions & 0 deletions test/testdata/configs/misspell.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
linters-settings:
misspell:
locale: US
ignore-words:
- langauge
- Dialogue
1 change: 1 addition & 0 deletions test/testdata/misspell.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ func Misspell() {
}

// the word langauge should be ignored here: it's set in config
// the word Dialogue should be ignored here: it's set in config