From 77a015b96db8727bb12d0869f180a44d087f6319 Mon Sep 17 00:00:00 2001 From: Lukasz Kasprzak Date: Tue, 15 Sep 2026 22:11:33 +0200 Subject: an undecided (stop) rule ends the search for that file --- internal/engine/match.go | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'internal/engine/match.go') diff --git a/internal/engine/match.go b/internal/engine/match.go index f6e1706..67f0c06 100644 --- a/internal/engine/match.go +++ b/internal/engine/match.go @@ -171,6 +171,12 @@ func evalFile(run *matchRun, file scan.File) FileMatch { } if res.Unreadable { f.undecided = true + if r.Conf.Stop { + // A (stop) rule that cannot be decided ends the search too: + // it may be the rule written to keep this file from the + // ones below (plan 12). + break + } } if !res.Match { continue @@ -321,6 +327,11 @@ func (e *Engine) Explain(ctx context.Context, path string) (*Explanation, error) match := trace.Value if trace.Unknown { f.undecided = true + if r.Conf.Stop { + rules = append(rules, RuleTrace{Rule: r, Trace: trace}) + stoppedBy = r.Name + ", which could not be decided" + continue + } } if match { f.matched = true -- cgit v1.3