diff options
Diffstat (limited to 'internal/engine/match.go')
| -rw-r--r-- | internal/engine/match.go | 11 |
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 |
