From 6cb4e298c8a7496f4b12b34a6c524db18d56d949 Mon Sep 17 00:00:00 2001 From: "Tobin C. Harding" Date: Mon, 9 Jun 2025 00:46:17 +1000 Subject: [PATCH] Remove _all_ the trailing whitespace Recently we tried to make the rustfmt bot remove trailing whitespace but wrote the `sed` command incorrectly - it only removes a single character. Tested by running the new command on #4600. --- .github/workflows/cron-weekly-rustfmt.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cron-weekly-rustfmt.yml b/.github/workflows/cron-weekly-rustfmt.yml index ba1152104..046ba8fe3 100644 --- a/.github/workflows/cron-weekly-rustfmt.yml +++ b/.github/workflows/cron-weekly-rustfmt.yml @@ -14,7 +14,7 @@ jobs: components: rustfmt - name: Run Nightly rustfmt # Run the formatter and manually remove trailing whitespace. - run: cargo +nightly fmt && find . -type f -name '*.rs' -exec sed -i 's/ $//' {} \; + run: cargo +nightly fmt && git ls-files -- '*.rs' -z | xargs sed -E -i'' -e 's/[[:space:]]+$//' - name: Get the current date run: echo "date=$(date +'%Y-%m-%d')" >> $GITHUB_ENV - name: Create Pull Request