mirror of
https://github.com/crate-ci/typos.git
synced 2026-11-23 13:47:56 +01:00
Add "--force-exclude" option
This commit is contained in:
1 parent
442b1199da
commit
8314a1567d
6 files changed
+17
-13
No files matched your search
@@ -46,6 +46,10 @@ pub(crate) struct Args {
|
||||
#[arg(short = 'j', long = "threads", default_value = "0")]
|
||||
pub(crate) threads: usize,
|
||||
|
||||
/// Respect excluded files even for paths passed explicitly.
|
||||
#[arg(long, help_heading = None)]
|
||||
pub(crate) force_exclude: bool,
|
||||
|
||||
/// Custom config file
|
||||
#[arg(short = 'c', long = "config", help_heading = "Config")]
|
||||
pub(crate) custom_config: Option<std::path::PathBuf>,
|
||||
|
||||
@@ -216,6 +216,11 @@ fn run_checks(args: &args::Args) -> proc_exit::ExitResult {
|
||||
let overrides = overrides
|
||||
.build()
|
||||
.with_code(proc_exit::sysexits::CONFIG_ERR)?;
|
||||
if args.force_exclude {
|
||||
if let ignore::Match::Ignore(_) = overrides.matched(path, path.is_dir()) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
walk.overrides(overrides);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user