Skip to content

tidy: use --bless for tidy spellcheck instead of spellcheck:fix #143493

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jul 6, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions src/tools/tidy/src/ext_tool_checks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,7 @@ fn check_impl(
let shell_lint = lint_args.contains(&"shell:lint") || shell_all;
let cpp_all = lint_args.contains(&"cpp");
let cpp_fmt = lint_args.contains(&"cpp:fmt") || cpp_all;
let spellcheck_all = lint_args.contains(&"spellcheck");
let spellcheck_fix = lint_args.contains(&"spellcheck:fix");
let spellcheck = lint_args.contains(&"spellcheck");

let mut py_path = None;

Expand Down Expand Up @@ -226,7 +225,7 @@ fn check_impl(
shellcheck_runner(&merge_args(&cfg_args, &file_args_shc))?;
}

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

if spellcheck_all {
eprintln!("spellcheck files");
} else if spellcheck_fix {
if bless {
eprintln!("spellcheck files and fix");
args.push("--write-changes");
} else {
eprintln!("spellcheck files");
}
spellcheck_runner(&args)?;
}
Expand Down
Loading