Module filtering

Module filtering 

Source
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