[clang-tools-extra] [clang-tidy] Update google todo checker with style guide changes. (PR #165565)

Quentin Khan via cfe-commits cfe-commits at lists.llvm.org
Fri Oct 31 08:30:53 PDT 2025


================
@@ -15,37 +15,84 @@ namespace clang::tidy::google::readability {
 
 class TodoCommentCheck::TodoCommentHandler : public CommentHandler {
 public:
+  enum class StyleKind { Parentheses, Hyphen };
+
   TodoCommentHandler(TodoCommentCheck &Check, std::optional<std::string> User)
       : Check(Check), User(User ? *User : "unknown"),
-        TodoMatch("^// *TODO *(\\(.*\\))?:?( )?(.*)$") {}
+        TodoMatch("^// *TODO *((\\((.*)\\))?:?( )?|: *(.*) *- *)?(.*)$") {
+    llvm::StringRef TodoStyleString = Check.Options.get("Style", "Hyphen");
+    if (TodoStyleString == "Parentheses") {
+      TodoStyle = StyleKind::Parentheses;
+    } else if (TodoStyleString == "Hyphen") {
+      TodoStyle = StyleKind::Hyphen;
+    } else {
----------------
qukhan wrote:

Done!

https://github.com/llvm/llvm-project/pull/165565


More information about the cfe-commits mailing list