From 355da9a44e4da7ec3a16613d6375234720e34df6 Mon Sep 17 00:00:00 2001 From: toofar Date: Tue, 3 Jan 2023 17:15:54 +1300 Subject: Run formatter tools twice Pyupgrade and black were fighting, which made this difficult to pin down. #4578 was a good test case. This makes it a bit slow now, of course. --- scripts/check_mergability.sh | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/scripts/check_mergability.sh b/scripts/check_mergability.sh index 69bf85875..5d4e6a6fa 100755 --- a/scripts/check_mergability.sh +++ b/scripts/check_mergability.sh @@ -249,6 +249,19 @@ rebase_with_formatting () { $cmd qutebrowser tests git commit -am "dropme! $cmd" # mark commits for dropping when we rebase onto the more recent master done + # Occasionally we get situations where black and pyupgrade build on each + # other to enable further changes. So the order you run them matters. But we + # have situations where each one enables the other, in both orders. So we + # run them all yet again to pick up any lingering changes from the first + # run. + # If we don't do this the leftover changes can be picked up by the smudge + # filter during the first rebase below and added to "fix lint" commits. Then + # since they don't have "dropme!" in the messages they stick in the branch + # and end up conflicting with the base branch. + echo "$cmds" | tr ' ' '\n' | while read cmd; do + $cmd qutebrowser tests + git commit -am "dropme! $cmd 2" + done git checkout -b ${prefix}pr/$number pr/$number @@ -427,6 +440,15 @@ else $cmd qutebrowser tests git commit -am "$cmd" done + # Occasionally we get situations where black and pyupgrade build on each + # other to enable further changes. So the order you run them matters. But we + # have situations where each one enables the other, in both orders. So we + # run them all yet again to pick up any lingering changes from the first + # run. + echo "$cmds" | tr ' ' '\n' | while read cmd; do + $cmd qutebrowser tests + git commit -am "$cmd second run" + done generate_report "$branch" y "$strategy" "$cmds" "$pull_request" done fi -- cgit v1.2.3-54-g00ecf