From 1955a6719c5f16f1579aef9452feef485889c189 Mon Sep 17 00:00:00 2001 From: Maikel Linke Date: Thu, 20 Apr 2023 11:06:37 +1000 Subject: [PATCH] Fix commit message formatting Git needs a blank line between the summary and the longer description. And `echo` doesn't interpret `\n` by default. --- script/rubocop-autocorrect.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/script/rubocop-autocorrect.sh b/script/rubocop-autocorrect.sh index b49e19639b..f82dc0f56a 100755 --- a/script/rubocop-autocorrect.sh +++ b/script/rubocop-autocorrect.sh @@ -26,7 +26,8 @@ grep "This cop supports safe autocorrection" -A 5 .rubocop_todo.yml\ echo "Trying to autocorrect safely: $cop" bundle exec rubocop --regenerate-todo --except "$cop" - echo "Safely autocorrect $cop\n" > .git/COMMIT_EDITMSG + echo "Safely autocorrect $cop" > .git/COMMIT_EDITMSG + echo "" >> .git/COMMIT_EDITMSG bundle exec rubocop --autocorrect >> .git/COMMIT_EDITMSG git add --all git commit --file .git/COMMIT_EDITMSG