about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMatthias Krüger <476013+matthiaskrgr@users.noreply.github.com>2025-07-06 10:03:24 +0200
committerGitHub <noreply@github.com>2025-07-06 10:03:24 +0200
commite25654fb94c6438749c1cfa7781f73128c367bbe (patch)
treea5f098ad175f961193222e8b8e6e757e204ddb9c
parent534c09a779e8b0d7bdd289a7a4af128eb2bdd30b (diff)
parent9f78173bb5270e6687a9b594e3ddb922f7b11bb1 (diff)
downloadrust-e25654fb94c6438749c1cfa7781f73128c367bbe.tar.gz
rust-e25654fb94c6438749c1cfa7781f73128c367bbe.zip
Rollup merge of #143493 - lolbinarycat:tidy-spellcheck-bless, r=Kobzol
tidy: use --bless for tidy spellcheck instead of spellcheck:fix

previous behavior was inconsistent with existing extra checks.

unsure if this needs a change tracker entry or a warning for people who try to use the old behavior.

unsure if we should call this `spellcheck:lint` for consistency.

making this consistent is a prerequisite for https://github.com/rust-lang/rust/pull/143398

cc `@nnethercote`

r? `@Kobzol`
-rw-r--r--src/bootstrap/src/utils/change_tracker.rs5
-rw-r--r--src/tools/tidy/src/ext_tool_checks.rs18
2 files changed, 17 insertions, 6 deletions
diff --git a/src/bootstrap/src/utils/change_tracker.rs b/src/bootstrap/src/utils/change_tracker.rs
index 68312a503ee..f5a958618f9 100644
--- a/src/bootstrap/src/utils/change_tracker.rs
+++ b/src/bootstrap/src/utils/change_tracker.rs
@@ -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",
+    },
 ];
diff --git a/src/tools/tidy/src/ext_tool_checks.rs b/src/tools/tidy/src/ext_tool_checks.rs
index 2904908fd43..d2da63a9703 100644
--- a/src/tools/tidy/src/ext_tool_checks.rs
+++ b/src/tools/tidy/src/ext_tool_checks.rs
@@ -65,6 +65,13 @@ 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;
@@ -72,8 +79,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;
 
@@ -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![
@@ -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)?;
     }