diff options
| author | Lukasz Kasprzak <lukas@labunix.xyz> | 2026-09-15 00:32:11 +0200 |
|---|---|---|
| committer | Lukasz Kasprzak <lukas@labunix.xyz> | 2026-09-15 00:32:11 +0200 |
| commit | ccd6faf3d10da0669631fb3e3ba17a46b9e63a09 (patch) | |
| tree | b1829034cf6c6fec206ba50deac59ff4369ce974 /internal/engine/match.go | |
| parent | 2f4e6dd8dfc7e18064e087c65ff9d28b4833cce2 (diff) | |
| download | krino-ccd6faf3d10da0669631fb3e3ba17a46b9e63a09.tar.gz krino-ccd6faf3d10da0669631fb3e3ba17a46b9e63a09.zip | |
(matched) is unknown after an undecided rule, so a catch-all leaves an unreadable file alone
Diffstat (limited to 'internal/engine/match.go')
| -rw-r--r-- | internal/engine/match.go | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/internal/engine/match.go b/internal/engine/match.go index c252596..2ef3ae1 100644 --- a/internal/engine/match.go +++ b/internal/engine/match.go @@ -169,6 +169,9 @@ func evalFile(run *matchRun, file scan.File) FileMatch { for _, w := range res.Warnings { fm.Warnings = append(fm.Warnings, r.Name+": "+w) } + if res.Unreadable { + f.undecided = true + } if !res.Match { continue } @@ -316,6 +319,9 @@ func (e *Engine) Explain(ctx context.Context, path string) (*Explanation, error) } trace := r.Cond.Explain(f) match := trace.Value + if trace.Unknown { + f.undecided = true + } if match { f.matched = true matched = append(matched, RuleMatch{Rule: r}) |
