Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
5 changes: 5 additions & 0 deletions src/bootstrap/src/utils/change_tracker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -446,4 +446,9 @@ pub const CONFIG_CHANGE_HISTORY: &[ChangeInfo] = &[
severity: ChangeSeverity::Info,
summary: "Added new option `build.tidy-extra-checks` to specify a default value for the --extra-checks cli flag.",
},
ChangeInfo {
change_id: 143493,
severity: ChangeSeverity::Warning,
summary: "The `spellcheck:fix` tidy extra check argument has been removed, use `--bless` instead",
},
];
18 changes: 12 additions & 6 deletions src/tools/tidy/src/ext_tool_checks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,15 +65,21 @@ fn check_impl(
None => vec![],
};

if lint_args.contains(&"spellcheck:fix") {
return Err(Error::Generic(
"`spellcheck:fix` is no longer valid, use `--extra=check=spellcheck --bless`"
.to_string(),
));
}

let python_all = lint_args.contains(&"py");
let python_lint = lint_args.contains(&"py:lint") || python_all;
let python_fmt = lint_args.contains(&"py:fmt") || python_all;
let shell_all = lint_args.contains(&"shell");
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 +232,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 +244,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