[Scripts] Add clang-format

This commit is contained in:
Andre Meyering 2018-10-31 14:45:06 +01:00
parent 8c992e539e
commit 96a0749d91
4 changed files with 173 additions and 168 deletions

View file

@ -0,0 +1,16 @@
#!/usr/bin/env bash
SCRIPT_PATH="$( cd "$(dirname "$0")" ; pwd -P )"
pushd "${SCRIPT_PATH}/.." > /dev/null
echo "Format all files using clang-format"
# We currently don't format test files
find . ! -path "./build/*" ! -path "./test/*" \
-type f \( -name "*.c" \
-o -name "*.hpp" \) \
-exec clang-format \
-i -style=file {} \;
popd > /dev/null