[PATCH] Initial clang-tidy architecture

Daniel Jasper djasper at google.com
Wed May 29 12:03:05 PDT 2013


  I imagine that there will be:
  a) common checks with a "common-" prefix
  b) Checks that can share the implementation, but that are configured with specific options and then registered via a specific name. E.g., there could be a google-include-order and an llvm-include-order. They could use the same implementation but they would be configured with different parameters.


================
Comment at: test/clang-tidy/select-checks.cpp:2
@@ +1,3 @@
+// RUN: grep -Ev "// *[A-Z-]+:" %s > %t.cpp
+// RUN: clang-tidy %t.cpp -fix -checks=llvm.* --
+// RUN: FileCheck -input-file=%t.cpp %s
----------------
Sean Silva wrote:
> Why is this `llvm.` when the check names are `llvm-`? Seems confusing.
This is a regular expression.

================
Comment at: clang-tidy/llvm/LLVMModule.cpp:88
@@ +87,3 @@
+    StringRef SourceFile = Sources.getFilename(HashLoc);
+    if (!SourceFile.endswith(".cc"))
+      return;
----------------
Sean Silva wrote:
> Shouldn't this be checking LangOptions instead of the extension? e.g. this wouldn't work for LLVM's `.cpp` naming.
This is a dummy implementation. Any real order-check will be totally different.


http://llvm-reviews.chandlerc.com/D884



More information about the cfe-commits mailing list