From: Andi-Bogdan Postelnicu Date: Tue, 9 Apr 2019 11:17:02 +0000 (+0000) Subject: ClangTidy: Avoid mixing stdout with stderror when dealing with a large number of... X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=965c5812f43809826772a31b613ba56894e47627;p=platform%2Fupstream%2Fllvm.git 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 --- 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()