]> git.ipfire.org Git - thirdparty/httpx.git/commitdiff
If `scripts/check` fails then prompt and autofix. (#952)
authorTom Christie <tom@tomchristie.com>
Fri, 15 May 2020 12:22:46 +0000 (13:22 +0100)
committerGitHub <noreply@github.com>
Fri, 15 May 2020 12:22:46 +0000 (13:22 +0100)
* If scripts/check fails then prompt and autofix

* Update scripts/test

Co-authored-by: Yeray Diaz Diaz <yeraydiazdiaz@gmail.com>
* Update test

Co-authored-by: Yeray Diaz Diaz <yeraydiazdiaz@gmail.com>
scripts/test

index 6a4a752f417c4b669ec5fd839fb5f827aa1373db..0ad0157ac2c55f59c215a9568e49928a7510de22 100755 (executable)
@@ -1,14 +1,24 @@
-#!/bin/sh -e
+#!/bin/sh
 
 export PREFIX=""
 if [ -d 'venv' ] ; then
     export PREFIX="venv/bin/"
 fi
 
-set -x
-
 if [ -z $GITHUB_ACTIONS ]; then
+    set +e
     scripts/check
+    while [ $? -ne 0 ]; do
+        read -p "Running 'scripts/check' failed. Do you want to run 'scripts/lint' now? [y/N]  " yn
+        case $yn in
+           [Yy]* ) :;;
+           * ) exit;;
+        esac
+        scripts/lint
+        scripts/check
+    done
 fi
 
+set -ex
+
 ${PREFIX}pytest $@