test: match generated/ at any depth in the deprecated-path guard - #250
Merged
Conversation
`typeScriptSources` excluded a top-level `src/generated` only. The hand-rolled recursion it replaced skipped a `generated` directory at any depth, and the narrowing was incidental to that cleanup rather than intended. A no-op today, since one such directory exists. The failure direction was safe but useless: a nested generated directory would have reported every deprecated path in its transcript as a false offender, which is loud and wrong rather than quiet and wrong. Proved in three states rather than reasoned about. With a nested `src/rules/generated/probe.ts` naming a deprecated path: before the change the guard reports it as an offender, after the change it does not, and a probe placed OUTSIDE a generated directory is still caught. That third state is the one worth running, since widening an exclusion is how a guard goes blind.
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.
typeScriptSourcesinpackages/cli/test/api-deprecated-paths.test.tsexcluded only a top-levelsrc/generated:The hand-rolled recursion this replaced (in #243) skipped a
generateddirectory at any depth. The narrowing was incidental to that cleanup, not intended, and the exclusion's own rationale — a generated directory is the schema's transcript, not a call site — is about what such a directory is, which does not depend on where it sits.Verified in three states, not two
A no-op today, since exactly one generated directory exists. So the interesting question is whether the change does what it claims and whether it costs the guard anything. With a planted
packages/cli/src/rules/generated/probe.tsnaming/cli/api/rule/{ruleId}/restore:generated/presentrules/generated/probe.ts references /cli/api/rulegenerated/presentgenerated/The third row is the one worth running. Widening an exclusion is how a guard quietly stops guarding, and a change that only demonstrates the new silence has not shown it kept the noise it needs.
Probes removed; the only file changed is the test.
Checks
pnpm typecheck,pnpm lint, and the full suite (1180 passed) all clean.Fixes #245