Ben Clayton | d4e6447 | 2019-02-01 08:18:19 +0000 | [diff] [blame] | 1 | SRC_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" |
Ben Clayton | 0b4bc58 | 2020-01-06 13:22:14 +0000 | [diff] [blame] | 2 | ROOT_DIR="$( cd "${SRC_DIR}/.." >/dev/null 2>&1 && pwd )" |
| 3 | TESTS_DIR="$( cd "${ROOT_DIR}/tests" >/dev/null 2>&1 && pwd )" |
Ben Clayton | 750660e | 2019-12-18 15:09:46 +0000 | [diff] [blame] | 4 | |
| 5 | CLANG_FORMAT=${CLANG_FORMAT:-clang-format} |
| 6 | |
Ben Clayton | 0b4bc58 | 2020-01-06 13:22:14 +0000 | [diff] [blame] | 7 | for DIR in "${SRC_DIR}/Device" "${SRC_DIR}/Pipeline" "${SRC_DIR}/Reactor" "${SRC_DIR}/System" "${SRC_DIR}/Vulkan" "${SRC_DIR}/WSI" "${TESTS_DIR}" |
Ben Clayton | d4e6447 | 2019-02-01 08:18:19 +0000 | [diff] [blame] | 8 | do |
| 9 | # Double clang-format, as it seems that one pass isn't always enough |
Ben Clayton | 0b4bc58 | 2020-01-06 13:22:14 +0000 | [diff] [blame] | 10 | 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 Clayton | d4e6447 | 2019-02-01 08:18:19 +0000 | [diff] [blame] | 12 | done |
Ben Clayton | d4e6447 | 2019-02-01 08:18:19 +0000 | [diff] [blame] | 13 | |