Files
concrete/.github/workflows/scripts/format_cpp.sh
2022-03-10 14:38:19 +01:00

13 lines
350 B
Bash
Executable File

#!/bin/bash
set -e -o pipefail
EXCLUDE_DIRS="-path ./compiler/include/boost-single-header -prune -o"
find ./compiler/{include,lib,src,tests} $EXCLUDE_DIRS -iregex '^.*\.\(cpp\|cc\|h\|hpp\)$' -print | xargs clang-format -i -style='file'
# show changes if any
git --no-pager diff
# fail if there is a diff, success otherwise
git diff | ifne exit 1