Repository navigation
test(rules): guard every declared rule's results against meta.checks - #2396
Merged
Merged
Conversation
…2343 Signed-off-by: longshore-nc9[bot] <360568931+longshore-nc9[bot]@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #2343.
What changed
bunfig.tomltest preload wrapsrunon every built-in rule that declaresmeta.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.meta.checksare skipped until their tranche declares them.packages/rules/tests/undeclared-check-guard.test.tsproves 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.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 typecheckin packages/rules, oxfmt and oxlint on the new filesNo changelog entry (contributor-only). Docs: none. Skill: none.