diff options
| -rwxr-xr-x | clang-tools-extra/test/clang-tidy/check_clang_tidy.sh | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/clang-tools-extra/test/clang-tidy/check_clang_tidy.sh b/clang-tools-extra/test/clang-tidy/check_clang_tidy.sh index 0904d0da2df..817e3a2c64f 100755 --- a/clang-tools-extra/test/clang-tidy/check_clang_tidy.sh +++ b/clang-tools-extra/test/clang-tidy/check_clang_tidy.sh @@ -30,10 +30,19 @@ fi # We need to keep the comments to preserve line numbers while avoiding empty # lines which could potentially trigger formatting-related checks. sed 's#// *CHECK-[A-Z-]*:.*#//#' "${INPUT_FILE}" > "${TEMPORARY_FILE}" +cp "${TEMPORARY_FILE}" "${TEMPORARY_FILE}.orig" clang-tidy "${TEMPORARY_FILE}" -fix --checks="-*,${CHECK_TO_RUN}" "$@" \ > "${TEMPORARY_FILE}.msg" 2>&1 +echo "------------------------ clang-tidy output ------------------------" +cat "${TEMPORARY_FILE}.msg" +echo "-------------------------------------------------------------------" + +echo "------------------------------ Fixes ------------------------------" +diff -u "${TEMPORARY_FILE}.orig" "${TEMPORARY_FILE}" || true +echo "-------------------------------------------------------------------" + if grep -q 'CHECK-FIXES' "${INPUT_FILE}"; then FileCheck -input-file="${TEMPORARY_FILE}" "${INPUT_FILE}" \ -check-prefix=CHECK-FIXES -strict-whitespace |

