Skip to main content

Module suppression_names_its_case

Module suppression_names_its_case 

Source
Expand description

Gate: a cited known-issue case resolves to a record.

A suppression over a defect this project does not own names the KI-<slug> case that justifies it. The name is worth nothing where it resolves to no record, so this gate reads the one token this convention defines and checks it against the records the instance keeps. A commit that deletes a record while a citation still names it is the failure this exists to catch.

The gate judges no suppression syntax. Whether a suppression states a reason belongs to the linter that honors it, where that linter has a rule for it: clippy has clippy::allow_attributes_without_reason and ESLint has eslint-comments/require-description. Where it has none, as Ruff does not, the reason is a review obligation. A delivered gate parses no grammar this convention does not define, so no table of comment openers, filename suffixes, or per-tool reason positions lives here.

SATISFIES spec-to-code:a-suppression-names-its-case

What counts as a citation is one token: KI- followed by a lowercase slug, opening and closing on a word boundary. A case id is a lowercase slug, so a token that runs on past one, such as KI-vendorXYZ, names no case. The gate reports nothing for it and does not resolve it as the shorter name either. A citation misspelled that way is invisible here, and the filename gate holds the records themselves to the same shape.

The scan reads every file the walk yields and needs no knowledge of the language it is reading. The registry row excludes the documentation root, because a specification, a chapter, and a record each write the token while teaching it. A project whose test fixtures write the token reserves those paths in its own declaration.

The gate runs always rather than over the staged files. Pre-commit selects staged files with --diff-filter=ACMRTUXB, which omits deletions, so a filter would hand this check an empty list on exactly the commit it is for.

Constants§

CITES
The rules this gate can cite.

Functions§

run
Judge every cited case against the records the instance keeps.