Repository navigation
feat(declared-literal): --exempt-prefix DIR/ per rule, self-expiring (v1.96.0) - #246
Merged
Merged
Conversation
…(v1.96.0) A consumer is importing a whole repository into a subdirectory (edge-host stack/, the trade-infra fold). The imported tree carries 71 copies of a path the importing repo's rule forbids; they are real debt, repointed at a later flip, and the import must stay byte-identical to its source until then. Declaring each file would also excuse any NEW copy in it; there was no other way to scope. `--exempt-prefix DIR/` attaches to one rule (like --declared) and excuses that rule only, under that directory only. It is debt, so it is built to end: - the files under it are still read, and the summary names the excused line and file counts; - a prefix holding no tracked file (wrong path) or no live match any more (debt paid) is exit 2 until the flag is deleted; - a prefix that is not a repo-relative directory ending '/' is exit 2 (a bare `vendor` would also excuse vendored.sh). Selftest: 8 new cases both directions. Must-fire: dropping the prefix filter from findings_in, or the "excuses nothing any more" check, each turns the selftest red. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.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.
A consumer is importing a whole repository into a subdirectory (edge-host stack/, the trade-infra
fold). The imported tree carries 71 copies of a path the importing repo's rule forbids; they are
real debt, repointed at a later flip, and the import must stay byte-identical to its source until
then. Declaring each file would also excuse any NEW copy in it; there was no other way to scope.
--exempt-prefix DIR/attaches to one rule (like --declared) and excuses that rule only, underthat directory only. It is debt, so it is built to end:
until the flag is deleted;
vendorwould alsoexcuse vendored.sh).
Selftest: 8 new cases both directions. Must-fire: dropping the prefix filter from findings_in, or
the "excuses nothing any more" check, each turns the selftest red.
Test plan:
ci-declared-literal --selftestOK;pytest tests/test_declared_literal_*.py122 passed; ruff clean; two mutations verified red.🤖 Generated with Claude Code