pub struct LintDocsArgs {
pub paths: Vec<PathBuf>,
pub staged: bool,
pub strict: bool,
pub fail_on: Option<Severity>,
}Fields§
§paths: Vec<PathBuf>Markdown files or directories. Defaults to the current directory.
staged: boolLint the markdown staged for commit. For a pre-commit hook.
The hook drep init writes uses this. Running the command bare would
also work - it is ~10 ms over a repository this size - but it reports
findings in documents the commit never touched, and per-commit noise
about someone else’s file is how a report-only gate gets switched off.
strict: boolExit non-zero when any check fires. Shorthand for --fail-on info.
fail_on: Option<Severity>Exit non-zero when a check at or above this severity fires.
Severity here answers one question: does the finding change how the
document renders? An unclosed fence does - everything below it becomes
code - so it alone is error. A malformed heading or link renders
wrong, so those are warning. Whitespace and line length render
identically, so they are info. --fail-on error is therefore the
calibration a hook wants: it blocks on the defect that breaks the
document and stays quiet about trailing spaces.
Implementations§
Source§impl LintDocsArgs
impl LintDocsArgs
Sourcepub fn threshold(&self) -> Option<Severity>
pub fn threshold(&self) -> Option<Severity>
The severity at or above which a finding fails the run, if any.
One place resolves --strict to a threshold, so the gate never has to
know that two flags exist. --strict is --fail-on info because
Info is the bottom of the vocabulary: every finding is at or above
it, which is precisely what “block on anything” means.
Trait Implementations§
Source§impl Args for LintDocsArgs
impl Args for LintDocsArgs
Source§fn augment_args<'b>(__clap_app: Command) -> Command
fn augment_args<'b>(__clap_app: Command) -> Command
Source§fn augment_args_for_update<'b>(__clap_app: Command) -> Command
fn augment_args_for_update<'b>(__clap_app: Command) -> Command
Command so it can instantiate self via
FromArgMatches::update_from_arg_matches_mut Read moreSource§impl Debug for LintDocsArgs
impl Debug for LintDocsArgs
Source§impl FromArgMatches for LintDocsArgs
impl FromArgMatches for LintDocsArgs
Source§fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>
fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>
Source§fn from_arg_matches_mut(
__clap_arg_matches: &mut ArgMatches,
) -> Result<Self, Error>
fn from_arg_matches_mut( __clap_arg_matches: &mut ArgMatches, ) -> Result<Self, Error>
Source§fn update_from_arg_matches(
&mut self,
__clap_arg_matches: &ArgMatches,
) -> Result<(), Error>
fn update_from_arg_matches( &mut self, __clap_arg_matches: &ArgMatches, ) -> Result<(), Error>
ArgMatches to self.Source§fn update_from_arg_matches_mut(
&mut self,
__clap_arg_matches: &mut ArgMatches,
) -> Result<(), Error>
fn update_from_arg_matches_mut( &mut self, __clap_arg_matches: &mut ArgMatches, ) -> Result<(), Error>
ArgMatches to self.