hanchenye-llvm-project/polly/utils/check_format.sh

20 lines
288 B
Bash
Raw Normal View History

#!/bin/bash
OK=0
for ARG in "$@"
do
clang-format $1 | diff -u $1 -
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