sf64/tools/check_format.sh
Alejandro Javier Asenjo Nitti bc14ecbb17 check_format correction
2023-10-16 16:02:23 -03:00

24 lines
510 B
Bash
Executable File

#!/bin/bash
STATUSOLD=`git status --porcelain`
./tools/format.py -j
if [ $? -ne 0 ]
then
echo "Formatter failed. Exiting."
exit -1
fi
STATUSNEW=`git status --porcelain`
if [ "${STATUSOLD}" != "${STATUSNEW}" ];
then
echo ""
echo "Misformatted files found. Run 'make format' and verify codegen is not impacted."
echo ""
diff --unified=0 --label "Old git status" <(echo "${STATUSOLD}") --label "New git status" <(echo "${STATUSNEW}")
echo ""
echo "Exiting."
exit 1
fi
exit 0