Skip to content

Commit 4fb2b91

Browse files
committed
tidy: add better error reporting for if typos can't be run
1 parent 140bb2d commit 4fb2b91

File tree

1 file changed

+10
-2
lines changed
  • src/tools/tidy/src/extra_checks

1 file changed

+10
-2
lines changed

src/tools/tidy/src/extra_checks/mod.rs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -582,8 +582,16 @@ fn shellcheck_runner(args: &[&OsStr]) -> Result<(), Error> {
582582
fn spellcheck_runner(outdir: &Path, args: &[&str]) -> Result<(), Error> {
583583
let bin_path = ensure_version_or_cargo_install(outdir, "typos-cli", "typos", "1.34.0")?;
584584

585-
let status = Command::new(bin_path).args(args).status()?;
586-
if status.success() { Ok(()) } else { Err(Error::FailedCheck("typos")) }
585+
match Command::new(bin_path).args(args).status() {
586+
Ok(status) => {
587+
if status.success() {
588+
Ok(())
589+
} else {
590+
Err(Error::FailedCheck("typos"))
591+
}
592+
}
593+
Err(err) => Err(Error::Generic(format!("failed to run typos tool: {err:?}"))),
594+
}
587595
}
588596

589597
/// Check git for tracked files matching an extension

0 commit comments

Comments
 (0)