Luna/tools/check-formatting.sh
apio 773cd576d1
Some checks failed
Build and test / build (push) Failing after 1m41s
tools: Print clang-format version
2024-12-23 23:12:57 +01:00

34 lines
476 B
Bash
Executable File

#!/usr/bin/env bash
source $(dirname $0)/env.sh
cd $LUNA_ROOT
source tools/sources.sh
ALL_OK=1
clang-format --version
for f in ${SOURCES[@]}
do
clang-format -n $f 2>&1 | tee -a /tmp/clang-format-output | grep -q ^
RESULT=$?
if [ "$RESULT" -eq "0" ]
then
echo "File $f needs formatting"
ALL_OK=0
fi
done
if [ $ALL_OK = "1" ]
then
echo "All files OK"
exit 0
fi
cat /tmp/clang-format-output
rm /tmp/clang-format-output
exit 1