MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / print_ignore_debug

Method print_ignore_debug

atomic-cli/src/commands/status.rs:455–499  ·  view source on GitHub ↗

Print debug information about ignore rules.

(&self, repo: &Repository)

Source from the content-addressed store, hash-verified

453impl Status {
454 /// Print debug information about ignore rules.
455 fn print_ignore_debug(&self, repo: &Repository) -> CliResult<()> {
456 use std::path::Path;
457
458 println!("=== Ignore Debug Information ===");
459 println!("Repository root: {}", repo.root().display());
460
461 let ignore_path = repo.root().join(".atomicignore");
462 println!(".atomicignore path: {}", ignore_path.display());
463 println!(".atomicignore exists: {}", ignore_path.exists());
464
465 if ignore_path.exists() {
466 if let Ok(content) = std::fs::read_to_string(&ignore_path) {
467 println!(".atomicignore content ({} bytes):", content.len());
468 for (i, line) in content.lines().enumerate() {
469 println!(" {}: {:?}", i + 1, line);
470 }
471 }
472 }
473
474 let rules = repo.ignore_rules();
475 println!("\nIgnore rules loaded:");
476 println!(" Has local rules: {}", rules.has_local_rules());
477 println!(" Has global rules: {}", rules.has_global_rules());
478 println!(" Local pattern count: {}", rules.local_pattern_count());
479 println!(" Global pattern count: {}", rules.global_pattern_count());
480
481 // Test some common paths
482 let test_paths = [
483 ("node_modules", true),
484 ("node_modules/foo", true),
485 ("node_modules/foo/bar.js", false),
486 ("target", true),
487 ("target/debug", true),
488 ("src/main.rs", false),
489 ];
490
491 println!("\nTest path matching:");
492 for (path, is_dir) in test_paths {
493 let ignored = rules.is_ignored(Path::new(path), is_dir);
494 println!(" {:40} is_dir={:5} ignored={}", path, is_dir, ignored);
495 }
496
497 println!("================================\n");
498 Ok(())
499 }
500}
501
502impl Command for Status {

Callers 1

runMethod · 0.80

Calls 5

ignore_rulesMethod · 0.80
rootMethod · 0.45
existsMethod · 0.45
linesMethod · 0.45
is_ignoredMethod · 0.45

Tested by

no test coverage detected