2019-11-02 11:59:04 +01:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
set -eu
|
|
|
|
|
|
|
|
fail="0"
|
|
|
|
|
2020-10-18 15:54:48 +02:00
|
|
|
clang-format --version
|
|
|
|
|
2019-11-02 11:59:04 +01:00
|
|
|
while read -r file; do
|
|
|
|
if ! diff -u <(cat "$file") <(clang-format "$file"); then
|
|
|
|
echo "$file differs!!!!!!!"
|
|
|
|
fail="1"
|
|
|
|
fi
|
2023-12-17 14:50:42 +01:00
|
|
|
done < <(find src/ tests/src benchmarks/src mocks/include -type f \( -iname "*.hpp" -o -iname "*.cpp" \))
|
2019-11-02 11:59:04 +01:00
|
|
|
|
|
|
|
if [ "$fail" = "1" ]; then
|
|
|
|
echo "At least one file is poorly formatted - check the output above"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
echo "Everything seems to be formatted properly! Good job"
|