Skip to main content

should_ignore

Function should_ignore 

Source
pub fn should_ignore(
    path: &Path,
    gitignore: Option<&Gitignore>,
    is_dir: bool,
) -> bool
Expand description

Check if a path should be ignored.

Uses the provided Gitignore matcher first (checking the full path and each ancestor directory), then falls back to the hardcoded IGNORE_DIRS list for paths not covered by .gitignore.

is_dir indicates whether the path is a directory. Pass false for file events from the watcher to avoid a redundant stat syscall per event.