pub enum Check {
BareUrl,
EmptyHeading,
LinkSyntaxInvalid,
LongLine,
MissingSpaceAfterHeading,
MultipleBlankLines,
TabCharacter,
TrailingBlankLines,
TrailingWhitespace,
UnclosedCodeFence,
}Expand description
The ten checks.
The wire names are a stable output contract. Check::as_str is the only
place a name is written.
Check::ALL is what the tests iterate, and it is a hand-maintained list:
Rust cannot enumerate an enum without a derive macro, so nothing makes a
new variant appear in it. What does force the author’s hand is that the
three match self methods below are exhaustive - a new variant fails to
compile until all three are extended, and ALL sits immediately above
them. Treat adding to ALL as part of adding a variant; a check missing
from it silently drops out of every test in this module.
Variants§
BareUrl
EmptyHeading
LinkSyntaxInvalid
LongLine
MissingSpaceAfterHeading
MultipleBlankLines
TabCharacter
TrailingBlankLines
TrailingWhitespace
UnclosedCodeFence
Implementations§
Source§impl Check
impl Check
Sourcepub const fn severity(self) -> Severity
pub const fn severity(self) -> Severity
How badly this check’s subject breaks the document.
One rule decides all ten: does it change how the document renders?
Severity::Error- the rest of the file renders as something else. Only an unclosed fence does that, and it does it to every line below itself.Severity::Warning- that line renders wrong. A heading that is not a heading, a link that is not a link.Severity::Info- renders identically; this is hygiene.
The rule matters because drep lint-docs --strict and --fail-on
downstream both gate on it, and “whitespace blocks a commit” is the
calibration failure that makes a gate get switched off.
Sourcepub const fn suggestion(self) -> &'static str
pub const fn suggestion(self) -> &'static str
What to do about it. Advice, never a literal replacement.
A literal replacement would be misleading for checks whose fix requires judgment, so this field consistently describes the intended result.
Trait Implementations§
impl Copy for Check
impl Eq for Check
Source§impl Ord for Check
impl Ord for Check
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialOrd for Check
impl PartialOrd for Check
impl StructuralPartialEq for Check
Auto Trait Implementations§
impl Freeze for Check
impl RefUnwindSafe for Check
impl Send for Check
impl Sync for Check
impl Unpin for Check
impl UnsafeUnpin for Check
impl UnwindSafe for Check
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.