Skip to content

Commit

Permalink
Fixed style output and printing versions
Browse files Browse the repository at this point in the history
  • Loading branch information
madsbk committed Dec 16, 2020
1 parent 6e6d868 commit b878894
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions ci/checks/style.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -41,12 +46,16 @@ 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"
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

0 comments on commit b878894

Please sign in to comment.