Skip to content

Commit e5d05ae

Browse files
committed
tidy: run typos check in src root, not current dir
1 parent 1dbeb66 commit e5d05ae

File tree

1 file changed

+9
-4
lines changed
  • src/tools/tidy/src/extra_checks

1 file changed

+9
-4
lines changed

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

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ fn check_impl(
298298
} else {
299299
eprintln!("spellcheck files");
300300
}
301-
spellcheck_runner(&outdir, &cargo, &args)?;
301+
spellcheck_runner(root_path, &outdir, &cargo, &args)?;
302302
}
303303

304304
if js_lint || js_typecheck {
@@ -581,11 +581,16 @@ fn shellcheck_runner(args: &[&OsStr]) -> Result<(), Error> {
581581
if status.success() { Ok(()) } else { Err(Error::FailedCheck("shellcheck")) }
582582
}
583583

584-
/// Check that spellchecker is installed then run it at the given path
585-
fn spellcheck_runner(outdir: &Path, cargo: &Path, args: &[&str]) -> Result<(), Error> {
584+
/// Ensure that spellchecker is installed then run it at the given path
585+
fn spellcheck_runner(
586+
src_root: &Path,
587+
outdir: &Path,
588+
cargo: &Path,
589+
args: &[&str],
590+
) -> Result<(), Error> {
586591
let bin_path = ensure_version_or_cargo_install(outdir, cargo, "typos-cli", "typos", "1.34.0")?;
587592

588-
match Command::new(bin_path).args(args).status() {
593+
match Command::new(bin_path).current_dir(src_root).args(args).status() {
589594
Ok(status) => {
590595
if status.success() {
591596
Ok(())

0 commit comments

Comments
 (0)