Skip to content

test(rules): guard every declared rule's results against meta.checks - #2396

Merged
nc9 merged 1 commit into
mainfrom
test/rules-undeclared-check-guard-2343
Nov 26, 2026
Merged

nc9 merged 1 commit into
mainfrom
test/rules-undeclared-check-guard-2343

Conversation

@longshore-nc9

@longshore-nc9 longshore-nc9 Bot commented Nov 25, 2026

Copy link
Copy Markdown
Contributor

Closes #2343.

What changed

  • A root bunfig.toml test preload wraps run on every built-in rule that declares meta.checks. Any result with a check name the rule does not declare throws, so problem runs are covered by every rule test, not only clean runs. Sync and async rules are both handled.
  • Rules without meta.checks are skipped until their tranche declares them.
  • packages/rules/tests/undeclared-check-guard.test.ts proves the guard fails on an undeclared problem name (sync and async), passes a declared one, skips undeclared rules, and that the preload wrapped exactly the declared rules.
  • No declared rule emitted an undeclared name anywhere in the suites, so no fixes or baseline were needed.

Commands run

  • bun run scripts/test-suites.ts --run rules: 12975 pass, 0 fail
  • --run audit-engine: 2471 pass, 0 fail; --run cli: 4668 pass, 0 fail; --run rest: 3968 pass, 0 fail (the preload is repo-wide)
  • bun run scripts/test-suites.ts --check, bun run typecheck in packages/rules, oxfmt and oxlint on the new files

No changelog entry (contributor-only). Docs: none. Skill: none.

…2343

Signed-off-by: longshore-nc9[bot] <360568931+longshore-nc9[bot]@users.noreply.github.com>
@nc9
nc9 marked this pull request as ready for review November 25, 2026 19:18
@nc9
nc9 merged commit f302ac7 into main Nov 26, 2026
13 of 22 checks passed
@nc9
nc9 deleted the test/rules-undeclared-check-guard-2343 branch November 26, 2026 10:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

rules: undeclared-check-name guard covers problem-path runs

1 participant