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

Krasimir Georgiev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Nov 17 02:25:49 PST 2017


krasimir updated this revision to Diff 123308.
krasimir added a comment.

- Remove METADATA


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"))
+    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.123308.patch
Type: text/x-patch
Size: 627 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20171117/2a40a993/attachment.bin>


More information about the cfe-commits mailing list