Skip to content

Exclude vendored/generated files from the whole check sweep, not just warning-suppression #198

Description

@missingbulb

Problem

Only warning-suppression consults ctx.vendored() (files git marks linguist-vendored / linguist-generated) to skip third-party/machine-written content. Every other check still scans those files as if they were the project's own authored code — so a check that fires on a recorded fixture or a generated artifact has no honest escape but a per-rule accept with 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: a GoogleCalendarEventCreator session (PR #664) added a subtree accept to silence warning-suppression findings inside cached third-party fixture HTML — clunky config to suppress findings that the vendored-skip (#188) already handles for that one check. The general fix is to make "not the project's code" a property of the sweep, honored by all checks, not a per-check opt-in.

Change

Promote the vendored/generated skip from a single check into the engine:

  • checks/lib/context.mjs: compute the linguist-vendored / linguist-generated set once and make ctx.files (the default iteration surface) exclude them. Expose the raw set as ctx.allFiles for the one check that legitimately reasons about generated files.
  • packs/universal/warning-suppression.mjs: drop its now-redundant manual ctx.vendored() skip.
  • packs/universal/generated-merge-driver.mjs: read ctx.allFiles so it still inspects GENERATED-named files even when a repo also marks them linguist-generated (preserves current behavior exactly).

Link targets (reference-integrity) resolve via ctx.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.

Docs (checks/README.md, context.mjs comment) and tests updated.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions