From 8765609ff6191b37a1b13b06758aa4e2a6396456 Mon Sep 17 00:00:00 2001 From: Joseph Kato Date: Sat, 9 Nov 2024 22:20:23 -0800 Subject: [PATCH] fix: check if we need to load a rule before trying This prevented custom implementations of the `spelling` extension point from providing suggestions in cases where the rule was already loaded. --- internal/check/action.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/check/action.go b/internal/check/action.go index 17043732..c619c534 100644 --- a/internal/check/action.go +++ b/internal/check/action.go @@ -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