Files
concrete/.github/workflows/scripts/format_cpp.sh
Ayoub Benaissa eef82a4713 style(compiler): c++ formatting with github action (#22)
* style(compiler): c++ formatting with github action

* style(compiler): update format script
2021-06-04 09:18:14 +02:00

15 lines
307 B
Bash
Executable File

#!/bin/bash
set -o pipefail
find ./compiler/{include,lib,src} \( -iname "*.h" -o -iname "*.cpp" -o -iname "*.cc" \) | xargs clang-format -i -style='file'
if [ $? -ne 0 ]
then
exit 1
fi
# show changes if any
git diff
# fail if there is a diff, success otherwise
! ( git diff | grep -q ^ ) || exit 1