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

Method print_ignore_debug

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

Print debug information about ignore rules.

(&self, repo: &Repository)

Source from the content-addressed store, hash-verified

428impl Status {
429 /// Print debug information about ignore rules.
430 fn print_ignore_debug(&self, repo: &Repository) -> CliResult<()> {
431 use std::path::Path;
432
433 println!("=== Ignore Debug Information ===");
434 println!("Repository root: {}", repo.root().display());
435
436 let ignore_path = repo.root().join(".atomicignore");
437 println!(".atomicignore path: {}", ignore_path.display());
438 println!(".atomicignore exists: {}", ignore_path.exists());
439
440 if ignore_path.exists() {
441 if let Ok(content) = std::fs::read_to_string(&ignore_path) {
442 println!(".atomicignore content ({} bytes):", content.len());
443 for (i, line) in content.lines().enumerate() {
444 println!(" {}: {:?}", i + 1, line);
445 }
446 }
447 }
448
449 let rules = repo.ignore_rules();
450 println!("\nIgnore rules loaded:");
451 println!(" Has local rules: {}", rules.has_local_rules());
452 println!(" Has global rules: {}", rules.has_global_rules());
453 println!(" Local pattern count: {}", rules.local_pattern_count());
454 println!(" Global pattern count: {}", rules.global_pattern_count());
455
456 // Test some common paths
457 let test_paths = [
458 ("node_modules", true),
459 ("node_modules/foo", true),
460 ("node_modules/foo/bar.js", false),
461 ("target", true),
462 ("target/debug", true),
463 ("src/main.rs", false),
464 ];
465
466 println!("\nTest path matching:");
467 for (path, is_dir) in test_paths {
468 let ignored = rules.is_ignored(Path::new(path), is_dir);
469 println!(" {:40} is_dir={:5} ignored={}", path, is_dir, ignored);
470 }
471
472 println!("================================\n");
473 Ok(())
474 }
475}
476
477impl 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