aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBob Haarman <inglorion@chromium.org>2024-02-01 19:24:17 +0000
committerChromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com>2024-02-01 22:50:30 +0000
commit6600638af008e85427808e8237fdcedc97c2d44e (patch)
tree75be12e2f1cdf6f0c674ca235ff42814b9acb439
parentee70ef2a95232eb60b7fb2c1732af5040fe92160 (diff)
downloadtoolchain-utils-6600638af008e85427808e8237fdcedc97c2d44e.tar.gz
auto_update_rust_bootstrap: fix whitespace in commit message
auto_update_rust_bootstrap.py writes commit messages using f-strings and textwrap.dedent. However, dedent only removes whitespace from the beginning of lines, and the code used line continuations that cause repeated whitespace inside of lines. This change moves things around a bit so that messages are formatted as expected. BUG=None TEST=Ran the script, checked the resulting commit message. Change-Id: Ia9ba93b64bcb214d17e90e96567349c3bd7fdeb6 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/5259243 Reviewed-by: George Burgess <gbiv@chromium.org> Commit-Queue: Bob Haarman <inglorion@chromium.org> Tested-by: Bob Haarman <inglorion@chromium.org>
-rwxr-xr-xrust_tools/auto_update_rust_bootstrap.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/rust_tools/auto_update_rust_bootstrap.py b/rust_tools/auto_update_rust_bootstrap.py
index 2eddadfe..2a6b1500 100755
--- a/rust_tools/auto_update_rust_bootstrap.py
+++ b/rust_tools/auto_update_rust_bootstrap.py
@@ -746,6 +746,12 @@ def maybe_delete_old_rust_bootstrap_ebuilds(
update_ebuild_manifest(remaining_ebuild)
if commit:
many = len(discardable_ebuilds) > 1
+ message_lines = [
+ "Rust has moved on in ChromeOS, so",
+ "these ebuilds are" if many else "this ebuild is",
+ "no longer needed.",
+ ]
+ message = textwrap.fill("\n".join(message_lines))
commit_all_changes(
chromiumos_overlay,
rust_bootstrap_dir,
@@ -753,9 +759,7 @@ def maybe_delete_old_rust_bootstrap_ebuilds(
f"""\
rust-bootstrap: remove unused ebuild{"s" if many else ""}
- Rust has moved on in ChromeOS, so \
- {"these ebuilds are" if many else "this ebuild is"} \
- no longer needed.
+ {message}
BUG={TRACKING_BUG}
TEST=CQ