Skip to content

Commit 971feb6

Browse files
committed
tidy: use --bless for tidy spellcheck instead of spellcheck:fix
previous behavior was inconsistent with existing extra checks.
1 parent fd9ca71 commit 971feb6

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

src/tools/tidy/src/ext_tool_checks.rs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,7 @@ fn check_impl(
7272
let shell_lint = lint_args.contains(&"shell:lint") || shell_all;
7373
let cpp_all = lint_args.contains(&"cpp");
7474
let cpp_fmt = lint_args.contains(&"cpp:fmt") || cpp_all;
75-
let spellcheck_all = lint_args.contains(&"spellcheck");
76-
let spellcheck_fix = lint_args.contains(&"spellcheck:fix");
75+
let spellcheck = lint_args.contains(&"spellcheck");
7776

7877
let mut py_path = None;
7978

@@ -226,7 +225,7 @@ fn check_impl(
226225
shellcheck_runner(&merge_args(&cfg_args, &file_args_shc))?;
227226
}
228227

229-
if spellcheck_all || spellcheck_fix {
228+
if spellcheck {
230229
let config_path = root_path.join("typos.toml");
231230
// sync target files with .github/workflows/spellcheck.yml
232231
let mut args = vec![
@@ -238,11 +237,11 @@ fn check_impl(
238237
"./src/librustdoc",
239238
];
240239

241-
if spellcheck_all {
242-
eprintln!("spellcheck files");
243-
} else if spellcheck_fix {
240+
if bless {
244241
eprintln!("spellcheck files and fix");
245242
args.push("--write-changes");
243+
} else {
244+
eprintln!("spellcheck files");
246245
}
247246
spellcheck_runner(&args)?;
248247
}

0 commit comments

Comments
 (0)