From 965c5812f43809826772a31b613ba56894e47627 Mon Sep 17 00:00:00 2001 From: Andi-Bogdan Postelnicu Date: Tue, 9 Apr 2019 11:17:02 +0000 Subject: [PATCH] ClangTidy: Avoid mixing stdout with stderror when dealing with a large number of files. Summary: At Mozilla we are using this tool in order to perform review-time static-analysis, since some patches contain a large number of files we've discovered this issue, where `stderr` gets mixed with `stdout` thus obfuscating our possibility to parse the output. The patch that we are currently use can be found [here](https://searchfox.org/mozilla-central/source/build/build-clang/clang-tidy-8.patch). This is just an upstream of the original patch. Reviewers: JonasToth Reviewed By: JonasToth Subscribers: cfe-commits Tags: #clang, #clang-tools-extra Differential Revision: https://reviews.llvm.org/D60453 llvm-svn: 357994 --- clang-tools-extra/clang-tidy/tool/run-clang-tidy.py | 1 + 1 file changed, 1 insertion(+) diff --git a/clang-tools-extra/clang-tidy/tool/run-clang-tidy.py b/clang-tools-extra/clang-tidy/tool/run-clang-tidy.py index cfd4f41..648c17e 100755 --- a/clang-tools-extra/clang-tidy/tool/run-clang-tidy.py +++ b/clang-tools-extra/clang-tidy/tool/run-clang-tidy.py @@ -172,6 +172,7 @@ def run_tidy(args, tmpdir, build_path, queue, lock, failed_files): with lock: sys.stdout.write(' '.join(invocation) + '\n' + output.decode('utf-8') + '\n') if len(err) > 0: + sys.stdout.flush() sys.stderr.write(err.decode('utf-8') + '\n') queue.task_done() -- 2.7.4