Skip to content

Commit db9d68f

Browse files
authored
Fix clang-format on CI (#7374)
Make it print the diff again. Previously, when there was a formatting problem, the script would exit the first time it ran `git clang-format` without printing the results. Update the script to ignore errors on that first run to ensure it makes it to the part where the results are printed.
1 parent 0402784 commit db9d68f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

scripts/clang-format-diff.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ LLVM_VERSION=${LLVM_VERSION:=17}
1515

1616
MERGE_BASE=$(git merge-base $BRANCH HEAD)
1717
FORMAT_ARGS="--binary=clang-format-${LLVM_VERSION} ${MERGE_BASE}"
18-
FORMAT_MSG=$(git clang-format ${FORMAT_ARGS} -q --diff)
18+
FORMAT_MSG=$(git clang-format ${FORMAT_ARGS} -q --diff || true)
1919
if [ -n "$FORMAT_MSG" -a "$FORMAT_MSG" != "no modified files to format" ]
2020
then
2121
echo "Please run git clang-format with clang-format-${LLVM_VERSION} before committing, or apply this diff:"

0 commit comments

Comments
 (0)