Skip to content

Commit

Permalink
fix: check if we need to load a rule before trying
Browse files Browse the repository at this point in the history
This prevented custom implementations of the `spelling` extension point from
providing suggestions in cases where the rule was already loaded.
  • Loading branch information
jdkato committed Nov 10, 2024
1 parent 399cb17 commit 8765609
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion internal/check/action.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ func spelling(alert core.Alert, cfg *core.Config) ([]string, error) {
return suggestions, err
}

if !strings.Contains(alert.Check, "Vale.") {
if _, ok := mgr.Rules()[alert.Check]; !ok {
err = mgr.AddRuleFromFile(alert.Check, path)
if err != nil {
return suggestions, err
Expand Down

0 comments on commit 8765609

Please sign in to comment.