Skip to content

Commit 1add399

Browse files
committed
Update style.sh to hook up to CI
1 parent a8aa1b4 commit 1add399

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

ci/checks/style.sh

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@ FLAKE_RETVAL=$?
2929
FLAKE_CYTHON=`flake8 --config=python/.flake8.cython`
3030
FLAKE_CYTHON_RETVAL=$?
3131

32+
# Run clang-format and check for a consistent code format
33+
CLANG_FORMAT=`python cpp/scripts/run-clang-format.py 2>&1`
34+
CLANG_FORMAT_RETVAL=$?
35+
3236
# Output results if failure otherwise show pass
3337
if [ "$ISORT_RETVAL" != "0" ]; then
3438
echo -e "\n\n>>>> FAILED: isort style check; begin output\n\n"
@@ -62,7 +66,15 @@ else
6266
echo -e "\n\n>>>> PASSED: flake8-cython style check\n\n"
6367
fi
6468

65-
RETVALS=($ISORT_RETVAL $BLACK_RETVAL $FLAKE_RETVAL $FLAKE_CYTHON_RETVAL)
69+
if [ "$CLANG_FORMAT_RETVAL" != "0" ]; then
70+
echo -e "\n\n>>>> FAILED: clang format check; begin output\n\n"
71+
echo -e "$CLANG_FORMAT"
72+
echo -e "\n\n>>>> FAILED: clang format check; end output\n\n"
73+
else
74+
echo -e "\n\n>>>> PASSED: clang format check\n\n"
75+
fi
76+
77+
RETVALS=($ISORT_RETVAL $BLACK_RETVAL $FLAKE_RETVAL $FLAKE_CYTHON_RETVAL $CLANG_FORMAT_RETVAL)
6678
IFS=$'\n'
6779
RETVAL=`echo "${RETVALS[*]}" | sort -nr | head -n1`
6880

0 commit comments

Comments
 (0)