[PATCH] D40120: [clang-format] Add text proto filename detection

Krasimir Georgiev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Nov 16 03:40:04 PST 2017


krasimir created this revision.

Adds text proto filename detection.


https://reviews.llvm.org/D40120

Files:
  lib/Format/Format.cpp


Index: lib/Format/Format.cpp
===================================================================
--- lib/Format/Format.cpp
+++ lib/Format/Format.cpp
@@ -2084,6 +2084,11 @@
   if (FileName.endswith_lower(".proto") ||
       FileName.endswith_lower(".protodevel"))
     return FormatStyle::LK_Proto;
+  if (FileName.endswith_lower(".textpb") ||
+      FileName.endswith_lower(".pb.txt") ||
+      FileName.endswith_lower(".textproto") ||
+      FileName.endswith_lower(".asciipb") || FileName.endswith("METADATA"))
+    return FormatStyle::LK_TextProto;
   if (FileName.endswith_lower(".td"))
     return FormatStyle::LK_TableGen;
   return FormatStyle::LK_Cpp;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D40120.123153.patch
Type: text/x-patch
Size: 660 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20171116/249d4510/attachment.bin>


More information about the cfe-commits mailing list