pub enum ParseError {
MissingFields,
MissingName,
NameTaken(String),
TriggerInName(String),
Duplicate(String),
BadStage(String),
BadScope(String),
BadSeverity(String),
FixOnPrePush,
}Expand description
Why a line could not be used.
A type rather than a String: the prose belongs in Display, and a caller
that wants to ask “was this a duplicate?” should not have to grep for the
word. The tests used to assert on substrings, which coupled them to wording
and would have kept passing if the wording stayed while the meaning changed.
Variants§
MissingFields
MissingName
NameTaken(String)
Names a check compiled into the binary.
TriggerInName(String)
The name is a trigger, or carries one as a prefix.
pre-commit pre-commit-clippy … would declare a check whose SHORT
name is another check’s full id, so hook.skip pre-commit-clippy would
mean two things at once. The stage column supplies the trigger; writing
it again in the name is the one way to make an id ambiguous.
Duplicate(String)
A second USABLE line claiming a name already claimed ON THE SAME TRIGGER. The same name on both triggers is two checks, not a clash.
BadStage(String)
BadScope(String)
BadSeverity(String)
FixOnPrePush
A pre-push line asked to rewrite files.
Refused HERE, beside NameTaken and Duplicate, rather than as a
runtime “contract violation” at push time: same fact, discovered
earlier, by more people, at the moment it is cheapest to fix. A pre-push
hook must not modify the worktree or index — the pushed commit would
then differ from the tree the developer is looking at.
Trait Implementations§
Source§impl Clone for ParseError
impl Clone for ParseError
Source§fn clone(&self) -> ParseError
fn clone(&self) -> ParseError
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more