From 51b70b3fca3e787948a7df8dc45a5ee338a71eb4 Mon Sep 17 00:00:00 2001 From: Tom Christie Date: Fri, 15 May 2020 13:22:46 +0100 Subject: [PATCH] If `scripts/check` fails then prompt and autofix. (#952) * If scripts/check fails then prompt and autofix * Update scripts/test Co-authored-by: Yeray Diaz Diaz * Update test Co-authored-by: Yeray Diaz Diaz --- scripts/test | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/scripts/test b/scripts/test index 6a4a752f..0ad0157a 100755 --- a/scripts/test +++ b/scripts/test @@ -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 $@ -- 2.47.3