[PATCH] D32294: [clang-tidy] run-clang-tidy.py: check if clang-apply-replacements succeeds

Jakub Kuderski via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Apr 20 12:34:33 PDT 2017


kuhar marked 2 inline comments as done.
kuhar added inline comments.


================
Comment at: clang-tidy/tool/run-clang-tidy.py:100
+  except:
+    print >>sys.stderr, "Unable to run clang-apply-replacements."
+    sys.exit(1)
----------------
kimgr wrote:
> alexfh wrote:
> > "Unable to run clang-apply-replacements" without any details seems to be far worse than just a default stack trace from an unhandled exception. At the very least add the message from the exception.
> I don't know what the general Python3 ambitions of this script is, but it would be nice if the new code didn't use the Python2-only print style.
> 
> You can:
> 
>     from __future__ import print_function
> 
> at the top of the file, and then use Python3-style print:
> 
>     print("Unable to run clang-apply-replacements", file=sys.stderr)
Thanks for feedback. I changed the code to print suggestion about clang-apply-replacements and stack trace. Is there a better way to make it easy to debug?


https://reviews.llvm.org/D32294





More information about the cfe-commits mailing list