2022-11-08 18:17:21 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
source $(dirname $0)/env.sh
|
|
|
|
|
|
|
|
cd $LUNA_ROOT
|
|
|
|
|
2022-11-16 16:37:18 +00:00
|
|
|
SOURCES=($(find kernel/src -type f | grep -v "\.asm"))
|
2023-03-11 09:38:34 +00:00
|
|
|
SOURCES+=($(find libluna/src -type f))
|
|
|
|
SOURCES+=($(find libluna/include/luna -type f))
|
2022-11-08 18:17:21 +00:00
|
|
|
|
|
|
|
ALL_OK=1
|
|
|
|
|
|
|
|
for f in ${SOURCES[@]}
|
|
|
|
do
|
2022-12-05 18:02:23 +00:00
|
|
|
clang-format -n $f 2>&1 | grep -q ^
|
|
|
|
RESULT=$?
|
2022-12-05 18:07:01 +00:00
|
|
|
if [ "$RESULT" -eq "0" ]
|
2022-11-08 18:17:21 +00:00
|
|
|
then
|
|
|
|
echo "File $f needs formatting"
|
|
|
|
ALL_OK=0
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
|
|
|
if [ $ALL_OK = "1" ]
|
|
|
|
then
|
|
|
|
echo "All files OK"
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
2023-03-11 09:38:34 +00:00
|
|
|
exit 1
|