pub struct Overrides(/* private fields */);Expand description
Every severity override visible here, resolved the way --get resolves it.
ONE subprocess for the whole stage, and — more importantly — a VALUE. The
dispatcher used to call severity_of inside the loop that classifies
outcomes, which put a git spawn in the middle of a fold and made the fold
impossible to test without a repository.
--get-regexp emits entries in precedence order, so folding with overwrite
lands on the same answer --get gives. That equivalence is not assumed:
the_batch_agrees_with_the_authority pins it against effective_override.
Implementations§
Source§impl Overrides
impl Overrides
pub fn read() -> Overrides
Sourcepub fn from_config(out: Option<String>) -> Overrides
pub fn from_config(out: Option<String>) -> Overrides
Built from --get-regexp-shaped text (amont.severity.<check> <value> per line, in git’s own precedence order — system, then
global, then local, then includes). pub so a reader that has
already fetched those lines for its own reasons (the fleet dashboard
needs the origin of each, which Overrides does not track) can still
ask this — the one place that must not get precedence wrong — rather
than re-deriving it from the lines by hand.
Sourcepub fn applied_to(&self, check: &str) -> Option<(&str, Severity)>
pub fn applied_to(&self, check: &str) -> Option<(&str, Severity)>
The configured key that applies to check, and what it says.
Several keys can name one check — pre-commit and clippy and
pre-commit-clippy all reach pre-commit-clippy. The most specific
wins, which is the rule anybody would guess and the only one that lets
you downgrade a whole trigger and then exempt one check from it.