[PATCH] D101868: [clang-format] Adds a formatter for aligning arrays of structs

Fred Grim via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri May 21 10:25:59 PDT 2021


feg208 added a comment.

In D101868#2774152 <https://reviews.llvm.org/D101868#2774152>, @MyDeveloperDay wrote:

> This looks like a good start..

Thanks. I am reworking it so I handle line breaking in a sane fashion and dropping the LineFormatter override since that really can't handle reformatting without reimplementing most of it

> All your tests are 3x3 have you considered mixing it up a bit.  i.e. 2x3, what is the impact on 1x5 and 5x1 ?

I am also adding a bunch more tests. I'll roll this in.

> Also how about nested structs, I'm interested to see what happens
>
>   {56, 23, { "ABC", 35 }}
>   {57, 24, { "DEF", 36 }}

Will do. I added the braced initializer int constructor test to exercise the same code path. But it can't hurt to get this in there


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D101868/new/

https://reviews.llvm.org/D101868



More information about the cfe-commits mailing list