[PATCH] [clang-tidy] Add a checker that warns on TODO comments without username.
Alexander Kornienko
alexfh at google.com
Thu Sep 18 05:47:12 PDT 2014
Looks good provided that you fix the issues.
================
Comment at: clang-tidy/google/TodoCommentCheck.cpp:54
@@ +53,3 @@
+private:
+ TodoCommentCheck *Check;
+ llvm::Regex TodoMatch;
----------------
This could be a reference as well.
================
Comment at: test/clang-tidy/google-readability-todo.cpp:5
@@ +4,3 @@
+// TODOfix this
+// CHECK-WARNINGS: [[@LINE-1]]:1: warning: missing username/bug in TODO
+// CHECK-FIXES: // TODO({{[^)]+}}): fix this
----------------
It should be CHECK-MESSAGES:
================
Comment at: test/clang-tidy/google-readability-todo.cpp:6
@@ +5,3 @@
+// CHECK-WARNINGS: [[@LINE-1]]:1: warning: missing username/bug in TODO
+// CHECK-FIXES: // TODO({{[^)]+}}): fix this
+
----------------
Please make the comments distinct, so that they can be matched reliably. Currently, the test can pass even if one of the replacement is not done, as there's a matching string in line 24.
http://reviews.llvm.org/D5393
More information about the cfe-commits
mailing list