pub struct Declared {
pub fix: Fix,
pub files: bool,
pub docs_skip: bool,
pub name: String,
pub stage: Stage,
pub severity: Severity,
pub exts: Vec<String>,
pub names: Vec<String>,
pub dirs: Vec<String>,
pub opt_in: Vec<String>,
pub program: String,
pub args: Vec<String>,
}Expand description
A line that parsed. Every field means something.
program and args rather than one argv: a runnable check must have a
command, and splitting the head off makes that structural instead of a
split_first guard that can only ever be dead code.
Fields§
§fix: FixFix::Rewrite when the command column began fix .
files: boolThe command column carried the files marker.
docs_skip: boolThe command column began docs-skip — do not run on a commit whose
staged change only edits existing documentation (staged_docs_only).
name: String§stage: Stage§severity: Severity§exts: Vec<String>Extensions that gate it. Empty means any change — the * scope.
names: Vec<String>Exact filenames that gate it — the scope column’s bare tokens.
dirs: Vec<String>Directory triggers, each dir/**/*.ext — see parse_scope.
opt_in: Vec<String>Files the REPOSITORY must carry for this check to apply at all — the
scope column’s + half. Empty means always applicable, which is what
every declaration meant before amont add made a line something you
could acquire rather than write.
program: String§args: Vec<String>Implementations§
Source§impl Declared
impl Declared
Sourcepub fn id(&self) -> String
pub fn id(&self) -> String
<trigger>-<name>, the same shape a built-in has.
This is what hook.skip and amont.severity.<key> resolve against,
so a declared check answers to its trigger and its short name exactly as
a compiled-in one does. Before it had an id, hook.skip pre-commit
silenced fifteen built-ins and left every declared check running.