[PATCH] D48034: [clang-format] Discourage breaks in submessage entries

Krasimir Georgiev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jun 11 10:06:05 PDT 2018


krasimir added a comment.

In https://reviews.llvm.org/D48034#1128475, @sammccall wrote:

> All else equal, I'd expect this to be a hard rule, at least in google-style.
>
> "foo\n  { a: b }" --> "foo {\n  a: b\n}" only makes the first line longer, by 2 chars. So if 78 < indent + len("foo") <= 80 we're breaking the line limit, but that seems vanishingly rare.
>
> If the penalty is sufficient to stop it happening almost always, maybe it works out the same.


If we make this a hard rule, there's a better way: update `canBreak` to return `false`.


Repository:
  rC Clang

https://reviews.llvm.org/D48034





More information about the cfe-commits mailing list