fix(config): let enabled reach the check that declares it (CD-324) + docs fix (CD-325) - #215
Merged
Conversation
`Refactor.PurityHeuristic`'s only option is called `enabled`, and the config loader stripped that key out of every check's option bag before validation as a forward-compatible placeholder. The check's catalogue page told the user to write `enabled = true`; the check never saw it, so a registered check was unreachable by any user. `enabled` now flows through to the option bag like any other option, and `options_for_raw` drops it again only for the checks that do not declare it — so configs carrying a stray `enabled` keep loading rather than failing on upgrade. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019afugU2bTYCtXn6Vy9dn1v
`Design.LayerViolation`'s page offered `.cofferdamignore` as the simple way to keep tests out of layer analysis. That prunes the files before discovery, so they contribute no import edges either, and `Design.OrphanExport` then reports every symbol only the tests import as never imported in the project. Point at `[[overrides]] disabled = true` instead, which turns off the one check without removing the files from the graph. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019afugU2bTYCtXn6Vy9dn1v
enabled reach the check that declares it (CD-324)enabled reach the check that declares it (CD-324) + docs fix (CD-325)
Criterion benchmark comparison (PR head vs base branch) |
Criterion benchmark comparison (PR head vs base branch) |
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.
Two commits, both small.
CD-324 —
Refactor.PurityHeuristicwas unreachableIts only option is called
enabled, and the config loader listedenabledinMETA_KEYS— stripped out of every check's option bag before validation, as a forward-compatible placeholder. The check's own catalogue page tells the user to writeenabled = true, and the check never saw it. A registered check no user could turn on.enablednow flows through to the option bag like any other option;options_for_rawdrops it again only for the checks that do not declare it, so configs carrying a strayenabledkeep loading rather than hard-failing on upgrade (validate_optionsrejects unknown keys with an error, not a warning).The fix is deliberately silent for the inert case. Making it loud means routing a diagnostic through CD-311's unknown-key warning channel, which
options_for_rawhas no sink for; that is not worth the plumbing, and rejecting outright would be a breaking change for a key we told people was accepted.CD-325 — a docs recommendation that breaks another check
Design.LayerViolation's page offered.cofferdamignoreas the simple way to keep tests out of layer analysis. That prunes the files before discovery, so they contribute no import edges either, andDesign.OrphanExportthen reports every symbol only the tests import as never imported in the project. The page now points at[[overrides]]withdisabled = true. The underlying behaviour is unchanged and tracked on CD-325.Verification
cargo build --workspace,cargo test --workspace(1426 passed),cargo clippy --workspace --all-targets -D warnings,cargo fmt --check,gen-docs --checkvia the pre-commit hook, pluscofferdam check examples/purity_heuristic.tswithenabled = true— which now emits the two expectedRefactor.PurityHeuristicfindings and emitted nothing before.🤖 Generated with Claude Code
https://claude.ai/code/session_019afugU2bTYCtXn6Vy9dn1v