fix(lint): report an unavailable AST once per run, not per (file, rule)

Linting a march whose PCMs are not built produced 102 findings — 34 files times
three AST rules — for a single fact: the project has not been built for that
configuration. The one actionable sentence was buried.

Now recorded per file and reported once, naming the rules that could not run,
how many files were affected, one example reason, and what to do about it. Still
one error, so the run still fails; --no-ast remains the way to proceed without
building.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Jorijn van der Graaf 2026-07-31 00:05:40 +02:00
commit 7f71030b5b
2 changed files with 25 additions and 3 deletions

View file

@ -699,7 +699,10 @@ int main() {
Check(!ran, "ast: rule is skipped when the AST is unavailable");
Check(summary.errors > 0, "ast: unavailable AST counts as an error");
Check(!summary.Clean(), "ast: unavailable AST is not Clean");
Check(std::any_of(summary.findings.begin(), summary.findings.end(), [](const LintFinding& f) { return f.message.contains("needs an AST"); }), "ast: a finding explains why");
// Explained on stderr as one grouped message rather than a finding per
// (file, rule): a single missing PCM would otherwise bury the one fact
// that matters. The run still failing is the part that counts, and the
// two assertions above cover it.
}
// --no-ast skips those rules deliberately and exits normally.