Exclude vendored/generated files from the whole check sweep, not just warning-suppression - #199
Merged
Merged
Conversation
Only warning-suppression consulted ctx.vendored() to skip linguist-vendored / linguist-generated files; every other check still scanned recorded fixtures and machine-written output as if they were the project's own code, leaving a per-rule accept (which reads as "we accept this violation") as the only escape. Promote the skip into the engine: buildContext computes the vendored/generated set once and makes ctx.files exclude them, so every check skips them for free. The unfiltered set stays on ctx.allFiles for generated-merge-driver, the one check that reasons about generated files (preserves its behavior exactly). warning-suppression drops its now-redundant manual skip. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Ki3mVh7kskXFAdqu5Z37Am
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.
What & why
Only
warning-suppressionconsultedctx.vendored()to skip files git markslinguist-vendored/linguist-generated. Every other check still scanned recorded third-party fixtures and machine-written output as if they were the project's own code — so a check that fired on that content had no honest escape but a per-ruleacceptwith a reason, which reads as "we accept this violation" rather than the truth: this isn't our code, don't look at it.This surfaced downstream in GoogleCalendarEventCreator PR #664, which added a subtree
acceptto silencewarning-suppressioninside cached fixture HTML — clunky config for something the corpus should treat as out-of-scope. The general fix is to make "not the project's code" a property of the sweep, honored by all checks.Change
checks/lib/context.mjs— compute the vendored/generated set once and makectx.files(the default iteration surface) exclude them. The unfiltered set is exposed asctx.allFiles.packs/universal/warning-suppression.mjs— drop its now-redundant manualctx.vendored()skip; the engine does it.packs/universal/generated-merge-driver.mjs— readctx.allFiles, since it's the one check that reasons about generated files and must still see them even when a repo also marks themlinguist-generated(behavior preserved exactly).Link targets in
reference-integrityresolve viactx.exists()against the real tree, so linking into a vendored file is unaffected; only a vendored file's own outbound links / placement / markers stop being policed, which is correct.Verification
node --test checks/test/*.test.mjs skills/*/*.test.mjs→ 91 pass, including two new regression tests: the engine excludes vendored/generated fromctx.fileswhilectx.allFilesretains them, andgenerated-merge-driverstill flags a GENERATED file that also carrieslinguist-generated.node checks/run.mjson this repo → clean.warning-suppressionfindings (thedice.html/seatgeek.htmlfixtures are excluded by the engine), confirming PR #664's subtree accept is no longer needed.Docs updated (
checks/README.md,context.mjscomment).Closes #198
🤖 Generated with Claude Code
https://claude.ai/code/session_01Ki3mVh7kskXFAdqu5Z37Am
Generated by Claude Code