pub struct ConfigPathMatcher { /* private fields */ }Expand description
Precomputed config path matcher.
Holds all matching data for efficient is_known() checks.
Implementations§
Source§impl ConfigPathMatcher
impl ConfigPathMatcher
Sourcepub fn new(repo_root: &Path, _project_roots: Vec<Vec<String>>) -> Self
pub fn new(repo_root: &Path, _project_roots: Vec<Vec<String>>) -> Self
Create a new matcher. repo_root is used for absolute path normalization.
_project_roots is reserved for future project-root-anchored matching.
Sourcepub fn is_valid_config_extension_for_dir(
&self,
file_path: &Path,
config_dir_name: &str,
) -> bool
pub fn is_valid_config_extension_for_dir( &self, file_path: &Path, config_dir_name: &str, ) -> bool
Check if a file has a valid extension for the given config directory context.
Used by the excluded-tree probe: when the probe finds a known config dir
(e.g., .claude inside vendor/pkg/), files inside it should be classified
by extension alone — root-anchoring is bypassed because the probe already
verified the directory identity.
config_dir_path is the path from the config dir root downward relative to
the config dir itself (e.g., for .claude/skills/evil.md, pass skills/evil.md).
config_dir_name is the matched config dir name (e.g., .claude).
Sourcepub fn is_known(&self, path: &Path) -> ConfigMatch
pub fn is_known(&self, path: &Path) -> ConfigMatch
Check if a path matches a known config file pattern.
Accepts both repo-relative and absolute paths. Absolute paths are
normalized by stripping repo_root prefix. If the absolute path is
not under repo_root, returns NotConfig.
Auto Trait Implementations§
impl Freeze for ConfigPathMatcher
impl RefUnwindSafe for ConfigPathMatcher
impl Send for ConfigPathMatcher
impl Sync for ConfigPathMatcher
impl Unpin for ConfigPathMatcher
impl UnsafeUnpin for ConfigPathMatcher
impl UnwindSafe for ConfigPathMatcher
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