mirror of
https://github.com/HarbourMasters/Starship
synced 2026-05-23 06:54:39 -04:00
check_format.sh
This commit is contained in:
Executable
+23
@@ -0,0 +1,23 @@
|
||||
#!/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 ./tools/format.py 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
|
||||
Reference in New Issue
Block a user