From b878894ceda6dd7b8d73ce8ff3b92d9de7ecc35e Mon Sep 17 00:00:00 2001 From: "Mads R. B. Kristensen" Date: Wed, 16 Dec 2020 09:20:46 +0100 Subject: [PATCH] Fixed style output and printing versions --- ci/checks/style.sh | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/ci/checks/style.sh b/ci/checks/style.sh index ab026e5aa..aac9bd36e 100755 --- a/ci/checks/style.sh +++ b/ci/checks/style.sh @@ -12,17 +12,22 @@ PATH=/opt/conda/bin:$PATH . /opt/conda/etc/profile.d/conda.sh conda activate rapids +# Print versions +black --version +echo "isort, `isort --vn`" +echo "flake8, `flake8 --version`" + # Run isort and get results/return code -ISORT=`isort --recursive --check-only .` +ISORT=`isort --check-only dask_cuda 2>&1` ISORT_RETVAL=$? # Run black and get results/return code -BLACK=`black --check .` +BLACK=`black --check dask_cuda 2>&1` BLACK_RETVAL=$? # Run flake8 and get results/return code -FLAKE=`flake8 dask_cuda` -RETVAL=$? +FLAKE=`flake8 dask_cuda 2>&1` +FLAKE_RETVAL=$? # Output results if failure otherwise show pass if [ "$ISORT_RETVAL" != "0" ]; then @@ -41,7 +46,7 @@ else echo -e "\n\n>>>> PASSED: black style check\n\n" fi -if [ "$FLAKE" != "0" ]; then +if [ "$FLAKE_RETVAL" != "0" ]; then echo -e "\n\n>>>> FAILED: flake8 style check; begin output\n\n" echo -e "$FLAKE" echo -e "\n\n>>>> FAILED: flake8 style check; end output\n\n" @@ -49,4 +54,8 @@ else echo -e "\n\n>>>> PASSED: flake8 style check\n\n" fi +RETVALS=($ISORT_RETVAL $BLACK_RETVAL $FLAKE_RETVAL) +IFS=$'\n' +RETVAL=`echo "${RETVALS[*]}" | sort -nr | head -n1` + exit $RETVAL