2013-02-15 00:19:16 +08:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
OK=0
|
|
|
|
|
|
|
|
for ARG in "$@"
|
|
|
|
do
|
2013-02-15 00:20:55 +08:00
|
|
|
clang-format $1 | diff -u $1 -
|
2013-02-15 00:19:16 +08:00
|
|
|
|
|
|
|
if [[ $? -eq 1 ]]; then
|
|
|
|
OK=1
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
|
|
|
if [[ $OK -eq "1" ]]; then
|
|
|
|
echo "Error: clang-format reported formatting differences"
|
|
|
|
else
|
|
|
|
echo "OK: clang-format reported no formatting differences"
|
|
|
|
fi
|
|
|
|
|