Skip to content

Commit

Permalink
refactor(cli): Be explicit in overrides
Browse files Browse the repository at this point in the history
  • Loading branch information
epage committed Sep 16, 2024
1 parent 0e8148f commit 777cf42
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion crates/typos-cli/src/bin/typos-cli/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,17 @@ fn run_checks(args: &args::Args) -> proc_exit::ExitResult {
}
}
}
walk.overrides(overrides);
walk.filter_entry(move |entry| {
let path = entry.path();
let is_dir = entry.file_type().map(|t| t.is_dir()).unwrap_or(false);
let matched = overrides.matched(path, is_dir);
log::debug!("match({path:?}, {is_dir}) == {matched:?}");
match matched {
ignore::Match::None => true,
ignore::Match::Ignore(_) => false,
ignore::Match::Whitelist(_) => true,
}
});
}

// HACK: Diff doesn't handle mixing content
Expand Down

0 comments on commit 777cf42

Please sign in to comment.