Skip to content

Commit 777cf42

Browse files
committed
refactor(cli): Be explicit in overrides
1 parent 0e8148f commit 777cf42

File tree

1 file changed

+11
-1
lines changed
  • crates/typos-cli/src/bin/typos-cli

1 file changed

+11
-1
lines changed

crates/typos-cli/src/bin/typos-cli/main.rs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,17 @@ fn run_checks(args: &args::Args) -> proc_exit::ExitResult {
261261
}
262262
}
263263
}
264-
walk.overrides(overrides);
264+
walk.filter_entry(move |entry| {
265+
let path = entry.path();
266+
let is_dir = entry.file_type().map(|t| t.is_dir()).unwrap_or(false);
267+
let matched = overrides.matched(path, is_dir);
268+
log::debug!("match({path:?}, {is_dir}) == {matched:?}");
269+
match matched {
270+
ignore::Match::None => true,
271+
ignore::Match::Ignore(_) => false,
272+
ignore::Match::Whitelist(_) => true,
273+
}
274+
});
265275
}
266276

267277
// HACK: Diff doesn't handle mixing content

0 commit comments

Comments
 (0)