================
@@ -11,41 +11,100 @@
 #include "clang/Lex/Preprocessor.h"
 #include <optional>
 
-namespace clang::tidy::google::readability {
+namespace clang::tidy {
+
+namespace google::readability {
+
+enum class StyleKind { Parentheses, Hyphen };
+
+} // namespace google::readability
+
+template <> struct OptionEnumMapping<google::readability::StyleKind> {
+  static ArrayRef<std::pair<google::readability::StyleKind, StringRef>>
+  getEnumMapping() {
+    static constexpr std::pair<google::readability::StyleKind, StringRef>
+        Mapping[] = {
+            {google::readability::StyleKind::Hyphen, "Hyphen"},
+            {google::readability::StyleKind::Parentheses, "Parentheses"},
+        };
+    return {Mapping};
+  }
+};
+
+} // namespace clang::tidy
 
+namespace clang::tidy::google::readability {
 class TodoCommentCheck::TodoCommentHandler : public CommentHandler {
 public:
   TodoCommentHandler(TodoCommentCheck &Check, std::optional<std::string> User)
       : Check(Check), User(User ? *User : "unknown"),
-        TodoMatch("^// *TODO *(\\(.*\\))?:?( )?(.*)$") {}
+        TodoMatch(R"(^// *TODO *((\((.*)\))?:?( )?|: *(.*) *- *)?(.*)$)") {
+    llvm::StringRef TodoStyleString = Check.Options.get("Style", "Hyphen");
----------------
qukhan wrote:

Done.

https://github.com/llvm/llvm-project/pull/165565
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to