Skip to content
Myr

cargo fmt

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Ami Fischman · committed by Ami Fischman · parent 1993c76 · Browse files · 3 files+17 added−7 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

3 files+17 added−7 removed

  • tests:+12 added−2 removed
  • other:+5 added−5 removed

3 files+17 added−7 removed

modified:src/cli.rs+1 added-4 removed
527 unmodified lines
528 )]529 pub hyperlink: HyperlinkWhen,530531 /// Ignore directories containing the named entry.532 #[arg(533 long,534 value_name = "name"535 )]532 #[arg(long, value_name = "name")]533 pub ignore_contain: Vec<String>,534535 /// Set number of threads to use for searching & executing (default: number536 /// of available CPU cores)
409 unmodified lines
modified:src/walk.rs+4 added-1 removed
501 unmodified lines
502 let entry_path = entry.path();503504 // Filter out directories containing a given name.505 if entry_path.is_dir()506 && config.ignore_contain.iter().any(|ic| entry_path.join(ic).exists())506 && config507 .ignore_contain508 .iter()509 .any(|ic| entry_path.join(ic).exists())510 {511 return WalkState::Skip;512 }513
166 unmodified lines
modified:tests/tests.rs+12 added-2 removed
2722 unmodified lines
2723 let expected = "include/2724 include/foo2725 symlink2726 top";2727 te.assert_output(&["--ignore-contain=CACHEDIR.TAG", "--ignore-contain=ignoremyparent", "."], expected);2727 te.assert_output(2728 &[2729 "--ignore-contain=CACHEDIR.TAG",2730 "--ignore-contain=ignoremyparent",2731 ".",2732 ],2733 expected,2734 );2735}27362737#[test]2738fn test_ignore_contain_has_highest_precedence() {
6 unmodified lines
2745 "exclude/sub/nope",2746 ],2747 );2748 let expected = "include/foo";2742 te.assert_output(&["--ignore-contain=CACHEDIR.TAG", "--min-depth=2", "."], expected);2749 te.assert_output(2750 &["--ignore-contain=CACHEDIR.TAG", "--min-depth=2", "."],2751 expected,2752 );2753}