Add clang-format-all.sh to format all project sources

This commit is contained in:
Ben Clayton 2020-01-05 08:37:05 +00:00
parent 1be9bb6712
commit 8633abaf88

7
clang-format-all.sh Executable file
View File

@ -0,0 +1,7 @@
ROOT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
SRC_DIR=${ROOT_DIR}/src
CLANG_FORMAT=${CLANG_FORMAT:-clang-format}
# Double clang-format, as it seems that one pass isn't always enough
find ${SRC_DIR} -iname "*.h" -o -iname "*.cpp" | xargs ${CLANG_FORMAT} -i -style=file
find ${SRC_DIR} -iname "*.h" -o -iname "*.cpp" | xargs ${CLANG_FORMAT} -i -style=file