pub struct WalkConfig {
pub ignore_files: Option<Vec<String>>,
pub exclude: Option<Vec<String>>,
}Expand description
Configuration for directory walking behavior.
Controls which ignore files are respected and which directories are always
excluded. Deserialized from [walk] in .normalize/config.toml.
[walk]
ignore_files = [".gitignore"] # default
exclude = [] # default (empty); `normalize init` seeds [".git/"]Fields§
§ignore_files: Option<Vec<String>>List of gitignore-format files to respect. Default: [".gitignore"].
Set to [] to disable gitignore-based exclusion entirely.
exclude: Option<Vec<String>>Additional gitignore-style patterns to always skip. Default: empty
(per Rust Default convention — opinions live in
[crate::NormalizeConfig::bootstrap] in the main crate, which seeds
[".git/"] for new projects).
Patterns use the same syntax as .gitignore:
- A pattern with no slash (e.g.
node_modules,.git) matches any directory or file with that basename, at any depth. - A pattern with a slash (e.g.
crates/foo/build/,**/target/) is anchored relative to the project root. - Trailing
/restricts the match to directories. **matches any number of path segments.
Implementations§
Source§impl WalkConfig
impl WalkConfig
Sourcepub fn ignore_files(&self) -> Vec<&str>
pub fn ignore_files(&self) -> Vec<&str>
Returns the ignore files to respect, defaulting to [".gitignore"].
Sourcepub fn exclude(&self) -> Vec<&str>
pub fn exclude(&self) -> Vec<&str>
Returns the directory patterns to exclude. Empty when no patterns are
configured — Default is empty per Rust convention. Opinions like
“always exclude .git/” belong in a typed bootstrap constructor on the
owning config (see NormalizeConfig::bootstrap), not here.
Sourcepub fn compiled_excludes(&self, root: &Path) -> Gitignore
pub fn compiled_excludes(&self, root: &Path) -> Gitignore
Compile the configured exclude patterns into a gitignore matcher anchored at root.
Returns an empty matcher if no patterns are configured. Invalid patterns
are silently dropped (consistent with how .gitignore itself behaves).
Sourcepub fn is_excluded_path(
&self,
root: &Path,
rel_path: &Path,
is_dir: bool,
) -> bool
pub fn is_excluded_path( &self, root: &Path, rel_path: &Path, is_dir: bool, ) -> bool
Check whether a path (relative to root) matches any exclude pattern.
is_dir distinguishes directories from files (relevant for trailing-/ patterns).
For repeat queries, prefer building [compiled_excludes] once and querying
it directly; this method is a convenience for one-shot checks.
Trait Implementations§
Source§impl Clone for WalkConfig
impl Clone for WalkConfig
Source§fn clone(&self) -> WalkConfig
fn clone(&self) -> WalkConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for WalkConfig
impl Debug for WalkConfig
Source§impl Default for WalkConfig
impl Default for WalkConfig
Source§fn default() -> WalkConfig
fn default() -> WalkConfig
Source§impl<'de> Deserialize<'de> for WalkConfigwhere
WalkConfig: Default,
impl<'de> Deserialize<'de> for WalkConfigwhere
WalkConfig: Default,
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl JsonSchema for WalkConfig
impl JsonSchema for WalkConfig
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read more