areusch commented on code in PR #10933:
URL: https://github.com/apache/tvm/pull/10933#discussion_r846460118


##########
tests/lint/git-clang-format.sh:
##########
@@ -58,14 +70,21 @@ fi
 # Print out specific version
 ${CLANG_FORMAT} --version
 
-if [[ ${INPLACE_FORMAT} -eq 1 ]]; then
-    echo "Running inplace git-clang-format against" $1
-    git-${CLANG_FORMAT} --extensions h,mm,c,cc --binary=${CLANG_FORMAT} $1
+if [[ "$INPLACE_FORMAT" == "true" ]]; then
+    echo "Running inplace git-clang-format against $REVISION"
+    git-${CLANG_FORMAT} --extensions h,mm,c,cc --binary=${CLANG_FORMAT} 
"$REVISION"
     exit 0
 fi
 
-echo "Running git-clang-format against" $1
-git-${CLANG_FORMAT} --diff --extensions h,mm,c,cc --binary=${CLANG_FORMAT} $1 
1> /tmp/$$.clang-format.txt
+if [[ "$LINT_ALL_FILES" == "true" ]]; then
+    echo "Running git-clang-format against all C++ files"
+    FILES=$(git ls-files | grep -E '\.(c|cc|cpp|mm|h|hpp)$')
+    git-${CLANG_FORMAT} --diff --extensions h,mm,c,cc --binary=${CLANG_FORMAT} 
"$REVISION" ${FILES[@]} 1> /tmp/$$.clang-format.txt

Review Comment:
   nit: "${FILES[@]}", hopefully this doesn't blow up the max command-line 
length tho



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to