[PATCH] [clang-tidy] Add a little python script that can run clang-tidy and apply fixes over an entire codebase.

Benjamin Kramer benny.kra at gmail.com
Thu Sep 4 07:18:23 PDT 2014


================
Comment at: clang-tidy/tool/run-clang-tidy.py:108
@@ +107,3 @@
+  if max_task == 0:
+    import multiprocessing
+    max_task = multiprocessing.cpu_count()
----------------
alexfh wrote:
> Why not import it in the beginning?
Mostly because it's heavyweight and we only need this tiny bit of information. Thinking more about it I could also move it to the top.

================
Comment at: clang-tidy/tool/run-clang-tidy.py:120
@@ +119,3 @@
+  retval = 0
+  try:
+    while True:
----------------
alexfh wrote:
> I'm still a bit concerned about reimplementing xargs in Python. Especially if you have to handle ctrl-c manually.
In fact I had a version lying around that just calls xargs, but I don't know how to make it generate a random file name for each clang-tidy invocation. We use it to write out the fixits yaml.

http://reviews.llvm.org/D5188






More information about the cfe-commits mailing list