blob: e6fca4116f7314db8a0290d11893fac168f41e3b [file] [log] [blame]
Ben Claytond4e64472019-02-01 08:18:19 +00001SRC_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
Ben Clayton0b4bc582020-01-06 13:22:14 +00002ROOT_DIR="$( cd "${SRC_DIR}/.." >/dev/null 2>&1 && pwd )"
3TESTS_DIR="$( cd "${ROOT_DIR}/tests" >/dev/null 2>&1 && pwd )"
Ben Clayton750660e2019-12-18 15:09:46 +00004
5CLANG_FORMAT=${CLANG_FORMAT:-clang-format}
6
Ben Clayton0b4bc582020-01-06 13:22:14 +00007for DIR in "${SRC_DIR}/Device" "${SRC_DIR}/Pipeline" "${SRC_DIR}/Reactor" "${SRC_DIR}/System" "${SRC_DIR}/Vulkan" "${SRC_DIR}/WSI" "${TESTS_DIR}"
Ben Claytond4e64472019-02-01 08:18:19 +00008do
9 # Double clang-format, as it seems that one pass isn't always enough
Ben Clayton0b4bc582020-01-06 13:22:14 +000010 find ${DIR} -iname "*.hpp" -o -iname "*.cpp" -o -iname "*.inl" | xargs ${CLANG_FORMAT} -i -style=file
11 find ${DIR} -iname "*.hpp" -o -iname "*.cpp" -o -iname "*.inl" | xargs ${CLANG_FORMAT} -i -style=file
Ben Claytond4e64472019-02-01 08:18:19 +000012done
Ben Claytond4e64472019-02-01 08:18:19 +000013