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.