aboutsummaryrefslogtreecommitdiff
path: root/internal/engine/match.go
diff options
context:
space:
mode:
authorLukasz Kasprzak <lukas@labunix.xyz>2026-09-15 22:11:33 +0200
committerLukasz Kasprzak <lukas@labunix.xyz>2026-09-15 22:11:33 +0200
commit77a015b96db8727bb12d0869f180a44d087f6319 (patch)
treed6e4e485f4556a676fd92a6792602fec690065be /internal/engine/match.go
parent6b38d302daa54140e4e26ad903297a1bba0cbd41 (diff)
downloadkrino-77a015b96db8727bb12d0869f180a44d087f6319.tar.gz
krino-77a015b96db8727bb12d0869f180a44d087f6319.zip
an undecided (stop) rule ends the search for that file
Diffstat (limited to 'internal/engine/match.go')
-rw-r--r--internal/engine/match.go11
1 files changed, 11 insertions, 0 deletions
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