Make clang-format-all.sh only look at source files

clang-format will modify non source files and has no configuration options to ignore bash, python, or extensionless files. This CL is a follow up for: https://swiftshader-review.googlesource.com/c/git-hooks/+/54569 Bug: b/187094215 Change-Id: I72953bd07e3c16b70aab441a25c27abae31b6a87 Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/54689 Kokoro-Result: kokoro <noreply+kokoro@google.com> Reviewed-by: 's avatarNicolas Capens <nicolascapens@google.com> Commit-Queue: Sean Risser <srisser@google.com> Tested-by: 's avatarSean Risser <srisser@google.com>
parent 0cfdf0c2
...@@ -43,7 +43,7 @@ then ...@@ -43,7 +43,7 @@ then
done done
else else
BASEDIR=$(git rev-parse --show-toplevel) BASEDIR=$(git rev-parse --show-toplevel)
FILES=$(git diff --cached --name-only --diff-filter=ACM | grep -v '\.sh') FILES=$(git diff --cached --name-only --diff-filter=ACM | grep '\.cpp$\|\.hpp\|\.c$\|\.h$')
for FILE in $FILES for FILE in $FILES
do do
${CLANG_FORMAT} -i -style=file "$BASEDIR/$FILE" ${CLANG_FORMAT} -i -style=file "$BASEDIR/$FILE"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment