diff scripts/validate-commits @ 8340:bf85e6018daa

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.
author Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>
date Sat, 07 Mar 2020 20:48:02 +0100
parents 89e9aef9b983
children 68861940ee1e
line wrap: on
line diff
--- a/scripts/validate-commits	Fri Apr 10 16:54:50 2020 +0200
+++ b/scripts/validate-commits	Sat Mar 07 20:48:02 2020 +0100
@@ -40,14 +40,18 @@
     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"