driazati commented on code in PR #10933:
URL: https://github.com/apache/tvm/pull/10933#discussion_r846484193
##########
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:
the quotes stop it from word splitting or something or it may be hitting
some limit since I see the args are now truncated. In any case this isn't even
necessary here since `git-clang-format` will pick up this list anyways since it
runs with `REVISION` set to the first commit in the repo
--
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]