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

Alexander Kornienko via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Apr 20 08:59:55 PDT 2017


alexfh requested changes to this revision.
alexfh added inline comments.
This revision now requires changes to proceed.


================
Comment at: clang-tidy/tool/run-clang-tidy.py:99-101
+  except:
+    print >>sys.stderr, "Unable to run clang-apply-replacements."
+    sys.exit(1)
----------------
I'd place try/except in main around the call to apply_fixes() and also move `shutil.rmtree(tmpdir)` out of the `apply_fixes()` function.


================
Comment at: clang-tidy/tool/run-clang-tidy.py:100
+  except:
+    print >>sys.stderr, "Unable to run clang-apply-replacements."
+    sys.exit(1)
----------------
"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.


https://reviews.llvm.org/D32294





More information about the cfe-commits mailing list