pub fn batch_validate(
patterns: Vec<String>,
strict: bool,
recursive: bool,
max_depth: usize,
parallel: bool,
verbose: bool,
) -> Result<(), CliError>Expand description
Batch validate multiple HEDL files.
Validates multiple HEDL files for syntax and structural correctness, with optional parallel processing for improved performance on large file sets.
§Arguments
patterns- List of file patterns (glob patterns or explicit paths)strict- Iftrue, enables strict reference validation for all filesrecursive- Enable recursive directory traversalmax_depth- Maximum recursion depthparallel- Iftrue, processes files in parallel (automatically enabled for 4+ files)verbose- Iftrue, shows detailed progress information
§Returns
Returns Ok(()) if all files are valid, Err with a summary if any fail.
§Errors
Returns Err if:
- Any file cannot be read
- Any file contains syntax errors
- In strict mode, if any references cannot be resolved
§Examples
use hedl_cli::commands::batch_validate;
// Validate multiple files in parallel
let patterns = vec!["*.hedl".to_string()];
batch_validate(patterns, false, false, 10, true, false)?;
// Strict validation with verbose output
let patterns = vec!["**/*.hedl".to_string()];
batch_validate(patterns, true, true, 10, true, true)?;§Output
Displays progress information and a summary:
- Success/failure for each file (✓ or ✗)
- Detailed error messages for failures
- Final count of failures
§Performance
Automatically uses parallel processing when beneficial (4+ files by default).
Can be forced with the parallel flag for smaller file sets.