pub struct ExplicitIncludeMatchers { /* private fields */ }Expand description
Compiled matchers for the explicitly-named files in a set of config
include patterns (see explicit_file_name_glob).
The CLI walker consults this in two places that otherwise restrict
discovery to markdown extensions: the walker’s file-type filter and the
final lintable-file filter. The type filter can only match file names,
so it uses the (over-inclusive) file-name globs; the final filter is
the precise gate and matches the full pattern against the root-relative
path. Without the path check, a broad sibling pattern like docs/**
would inherit the non-standard-extension allowance of an explicit
pattern like templates/NOTES.tmpl for every file sharing its name.
Path matching follows gitignore anchoring: patterns without a / match
at any depth, patterns with one are anchored to the root the relative
path was computed against. * does not cross directory separators.
Invalid globs are skipped silently; the caller’s override handling already warns about unparseable include patterns.
Implementations§
Source§impl ExplicitIncludeMatchers
impl ExplicitIncludeMatchers
pub fn new(patterns: &[String]) -> Self
pub fn is_empty(&self) -> bool
Sourcepub fn file_name_globs(&self) -> impl Iterator<Item = &str>
pub fn file_name_globs(&self) -> impl Iterator<Item = &str>
The file-name globs, e.g. for registering on a walker type filter.
Sourcepub fn matches_relative_path(&self, path: &str) -> bool
pub fn matches_relative_path(&self, path: &str) -> bool
Whether the root-relative path matches any explicit include
pattern in full.
Auto Trait Implementations§
impl Freeze for ExplicitIncludeMatchers
impl RefUnwindSafe for ExplicitIncludeMatchers
impl Send for ExplicitIncludeMatchers
impl Sync for ExplicitIncludeMatchers
impl Unpin for ExplicitIncludeMatchers
impl UnsafeUnpin for ExplicitIncludeMatchers
impl UnwindSafe for ExplicitIncludeMatchers
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more