Start a custom .clang-format rule Also add clang-format-all.sh and clang-format-separate.sh to perform this operation. These files sit in the ./src directory. Bug: b/144825072 Change-Id: I5228ac59f7781ad1307c305949af7e7f9e0c31d1 Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/24308 Tested-by: Ben Clayton <bclayton@google.com> Reviewed-by: Nicolas Capens <nicolascapens@google.com> Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
diff --git a/src/clang-format-all.sh b/src/clang-format-all.sh new file mode 100755 index 0000000..c39ce41 --- /dev/null +++ b/src/clang-format-all.sh
@@ -0,0 +1,10 @@ +SRC_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" +pushd ${SRC_DIR} +for DIR in "Device" "Pipeline" "Reactor" "System" "Vulkan" "WSI" +do + # Double clang-format, as it seems that one pass isn't always enough + find ${SRC_DIR}/$DIR -iname "*.hpp" -o -iname "*.cpp" -o -iname "*.inl" | xargs clang-format -i + find ${SRC_DIR}/$DIR -iname "*.hpp" -o -iname "*.cpp" -o -iname "*.inl" | xargs clang-format -i +done +popd +