Expand description
Centralized file filtering logic
This module provides unified pattern matching and filtering functionality used across all commands (pack, diff, scan, map, chunk, index).
§Key Features
- Glob pattern support:
*.rs,src/**/*.ts,**/*.test.js - Substring matching:
node_modules,dist,target - Path component matching: Match against directory names
- Generic API: Works with any collection type
§Usage Example
use infiniloom_engine::filtering::{apply_exclude_patterns, apply_include_patterns};
use infiniloom_engine::types::RepoFile;
let mut files: Vec<RepoFile> = vec![/* ... */];
let exclude = vec!["node_modules".to_string(), "*.min.js".to_string()];
let include = vec!["src/**/*.rs".to_string()];
// Apply filters
apply_exclude_patterns(&mut files, &exclude, |f| &f.relative_path);
apply_include_patterns(&mut files, &include, |f| &f.relative_path);Functions§
- apply_
exclude_ patterns - Apply exclude patterns to a collection
- apply_
include_ patterns - Apply include patterns to a collection
- compile_
patterns - Compile patterns into glob::Pattern objects
- matches_
exclude_ pattern - Check if a path matches an exclude pattern
- matches_
include_ pattern - Check if a path matches an include pattern