[PATCH] D42373: [clang-format] Disable string literal breaking for text protos

Krasimir Georgiev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jan 22 07:05:20 PST 2018


krasimir created this revision.
krasimir added a reviewer: djasper.
Herald added subscribers: cfe-commits, klimek.

Commonly string literals in protos are already multiline, so breaking them
further is undesirable.


Repository:
  rC Clang

https://reviews.llvm.org/D42373

Files:
  lib/Format/Format.cpp


Index: lib/Format/Format.cpp
===================================================================
--- lib/Format/Format.cpp
+++ lib/Format/Format.cpp
@@ -675,6 +675,11 @@
   if (Language == FormatStyle::LK_TextProto) {
     FormatStyle GoogleStyle = getGoogleStyle(FormatStyle::LK_Proto);
     GoogleStyle.Language = FormatStyle::LK_TextProto;
+
+    // In protos, string literals are commonly multiline and already broken-up.
+    // Don't break them up even further, especially since we don't support
+    // reflowing them.
+    GoogleStyle.BreakStringLiterals = false;
     return GoogleStyle;
   }
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D42373.130888.patch
Type: text/x-patch
Size: 604 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20180122/d2365040/attachment.bin>


More information about the cfe-commits mailing list