From: Krasimir Georgiev Date: Wed, 24 Jan 2018 11:18:39 +0000 (+0000) Subject: [clang-format] Disable string literal breaking for text protos X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=88254eb22d0e65622e0fba71965142cb4798127c;p=clang [clang-format] Disable string literal breaking for text protos Summary: Commonly string literals in protos are already multiline, so breaking them further is undesirable. Reviewers: djasper Reviewed By: djasper Subscribers: klimek, cfe-commits Differential Revision: https://reviews.llvm.org/D42373 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@323319 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Format/Format.cpp b/lib/Format/Format.cpp index 0da0cea708..b709e9f84a 100644 --- a/lib/Format/Format.cpp +++ b/lib/Format/Format.cpp @@ -675,6 +675,12 @@ FormatStyle getGoogleStyle(FormatStyle::LanguageKind Language) { if (Language == FormatStyle::LK_TextProto) { FormatStyle GoogleStyle = getGoogleStyle(FormatStyle::LK_Proto); GoogleStyle.Language = FormatStyle::LK_TextProto; + + // Text protos are currently mostly formatted inside C++ raw string literals + // and often the current breaking behavior of string literals is not + // beneficial there. Investigate turning this on once proper string reflow + // has been implemented. + GoogleStyle.BreakStringLiterals = false; return GoogleStyle; }