Documentation
¶
Overview ¶
allowlist_fold.go — the run-scoped state exemption suppression needs beyond the finding it is judging. Split from engine.go, which the 750-line vendor cap bounds; same package.
Package engine runs compiled rules over a FileSet: phase 1 fans files out to a worker pool, phase 2 fans finalizers out to a second one (spec §6). A crashed rule is an engine error, never a pass (spec §11).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Timing ¶ added in v0.6.2
Run evaluates every rule against every in-scope file, then finalizers. workers <= 0 means GOMAXPROCS. Findings come back deterministically sorted and include suppressed findings (spec §5 exemptions): callers that gate on findings must filter with finding.Unsuppressed. Timing records per-rule total evaluation wall time: phase 1 sums the rule's per-file evaluations, phase 2 adds its finalizer. It is observability, never input to a verdict — no finding, sort order, or exit code reads it.
func RunTimed ¶ added in v0.6.2
func RunTimed(rls []*config.Rule, fset *scan.FileSet, workers int, progress func(ruleID string, elapsed time.Duration)) ([]finding.Finding, Timing, error)
RunTimed is Run plus per-rule wall-clock accounting, and an optional completion callback: progress (may be nil) is invoked under the findings mutex as each finalizer finishes, with the rule's ID and its accumulated total — the hook behind `check -progress`. That flag exists because a whole-corpus lane can run for minutes with no output (every report format writes at the end), and an operator staring at a silent job cannot tell a slow rule from a hung one. Phase 1 cannot report per-rule completion the same way (a rule is complete only once every file has been visited), so the callback is finalizer-only; Timing covers both phases either way.