[PATCH] D127807: [clang-tidy] Properly forward clang-tidy output when running tests

Richard via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sun Jul 3 15:31:20 PDT 2022


This revision was automatically updated to reflect the committed changes.
Closed by commit rGf7a80c3d08d4: [clang-tidy] Properly forward clang-tidy output when running tests (authored by nicovank, committed by LegalizeAdulthood).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D127807/new/

https://reviews.llvm.org/D127807

Files:
  clang-tools-extra/test/clang-tidy/check_clang_tidy.py


Index: clang-tools-extra/test/clang-tidy/check_clang_tidy.py
===================================================================
--- clang-tools-extra/test/clang-tidy/check_clang_tidy.py
+++ clang-tools-extra/test/clang-tidy/check_clang_tidy.py
@@ -173,13 +173,13 @@
     print('Running ' + repr(args) + '...')
     clang_tidy_output = try_run(args)
     print('------------------------ clang-tidy output -----------------------')
-    print(clang_tidy_output.encode())
-    print('\n------------------------------------------------------------------')
+    print(clang_tidy_output.encode(sys.stdout.encoding, errors="replace").decode(sys.stdout.encoding))
+    print('------------------------------------------------------------------')
 
     diff_output = try_run(['diff', '-u', self.original_file_name, self.temp_file_name], False)
-    print('------------------------------ Fixes -----------------------------\n' +
-          diff_output +
-          '\n------------------------------------------------------------------')
+    print('------------------------------ Fixes -----------------------------')
+    print(diff_output)
+    print('------------------------------------------------------------------')
     return clang_tidy_output
 
   def check_fixes(self):


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D127807.441984.patch
Type: text/x-patch
Size: 1272 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20220703/94c7f43d/attachment-0001.bin>


More information about the cfe-commits mailing list