Skip to content

Commit

Permalink
Update code_style_check.sh (#243)
Browse files Browse the repository at this point in the history
  • Loading branch information
yijie-yang authored Nov 13, 2024
1 parent ffa84f7 commit 7e16ef3
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions ci/code_style_check.sh
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,10 @@ FIX_FORMAT_FLAG=${1}

LICENSE_CHECK_RESULT=$?

if [[ ${LICENSE_CHECK_RESULT} != 0 ]]; then
echo "License check failed. Please fix the corresponding licenses."
fi

############################################################
# Python formatting
############################################################
Expand All @@ -72,12 +76,16 @@ echo "Testing python formatting with ${PYINK_COMMAND}"
${PYINK_COMMAND}
PYTHON_FORMAT_RESULT=$?

# Re-enable exit on error now that we are done with the temporary git repo.
set -e

if [[ ${PYTHON_FORMAT_RESULT} != 0 ]]; then
echo "Python formatting issues found."
echo "To apply formatting automatically, run: ./format.sh"
fi
if [[ ${LICENSE_CHECK_RESULT} != 0 || \
${PYTHON_FORMAT_RESULT} != 0 \
]]
then
exit 1
fi
fi

# Re-enable exit on error now that we are done with the temporary git repo.
set -e

0 comments on commit 7e16ef3

Please sign in to comment.