# HG changeset patch # User Thomas De Schampheleire # Date 2020-03-07 20:48:02 # Node ID bf85e6018daad2740e6af0004a19d8a817a8ab7a # Parent 65b0d79ff29343e262e510110f53f03899129276 scripts: properly check for errors in whitespacecleanup/run-all-cleanup An error in whitespacecleanup, like a bug in isort that raises an exception, should be treated as a problem instead of silently ignored. diff --git a/scripts/validate-commits b/scripts/validate-commits --- a/scripts/validate-commits +++ b/scripts/validate-commits @@ -40,14 +40,18 @@ for rev in $(hg log -r "$1" -T '{node}\n pip install -e . -r dev_requirements.txt python-ldap python-pam # run-all-cleanup - scripts/run-all-cleanup - if ! hg update --check -q .; then - echo "run-all-cleanup did not give clean results!" + if ! scripts/run-all-cleanup ; then + echo "run-all-cleanup encountered errors!" result="NOK" - hg diff - hg revert -a else - result=" OK" + if ! hg update --check -q .; then + echo "run-all-cleanup did not give clean results!" + result="NOK" + hg diff + hg revert -a + else + result=" OK" + fi fi echo "$result: $rev (run-all-cleanup)" >> "$resultfile" diff --git a/scripts/whitespacecleanup.sh b/scripts/whitespacecleanup.sh --- a/scripts/whitespacecleanup.sh +++ b/scripts/whitespacecleanup.sh @@ -1,4 +1,4 @@ -#!/bin/bash -x +#!/bin/bash -xe # Enforce some consistency in whitespace - just to avoid spurious whitespaces changes