pub fn names_check(check: &str, pattern: &str) -> Option<Match>Expand description
Does pattern, as written in hook.skip or amont.severity.<pattern>,
name check?
A check’s id is <trigger>-<name>, and exactly three things name it:
| written | means |
|---|---|
pre-commit-clippy | that one check |
pre-commit | every check on that trigger |
clippy | that check, on any trigger |
Three exact comparisons. No substring. The previous rule was
check.contains(skip), which made hook.skip = clippy work by accident of
reach — and hook.skip = e disable all twenty checks by the same accident,
and lint-js silently also suppress lint-json-yaml. Naming the three
things a user actually means keeps every useful case and removes every
sharp edge, including the one the old doc comment called “not a bug”.
This reads the trigger out of the ID, which is not the same as deriving a
check’s stage: Stage remains a declared field and is what the dispatcher
obeys. Here we are parsing an identifier a human typed.
Defined ONCE because four callers need it — the dispatcher decides what runs, the severity resolver decides what blocks, the fleet view reports where a check applies, and the skip resolver computes reach. A reimplementation that disagreed would have the dashboard claim a check is active while the dispatcher skips it.