[llvm-dev] [RFC] Semi-Automatic clang-format of files with low frequency

Zachary Turner via llvm-dev llvm-dev at lists.llvm.org
Tue Jun 30 18:36:46 PDT 2020


On Tue, Jun 30, 2020 at 10:55 AM Matt Arsenault via llvm-dev <
llvm-dev at lists.llvm.org> wrote:

>
>
> On Jun 28, 2020, at 11:30, MyDeveloper Day via llvm-dev <
> llvm-dev at lists.llvm.org> wrote:
>
> I’m a contributor to clang-format and would like to see LLVM 100% clang
> formatted so we can use LLVM as a massive test-suite for clang-format when
> we make changes.
>
>
> My main issue with this would be that clang-format does things that I
> don’t believe are stated in the LLVM style guide and I also disagree with.
> There’s a whole set of cases where it makes unwelcome changes to put things
> that were on separate lines on a single line. Whenever I run clang-format,
> I typically git checkout -p to discard all of these.
>
> For example, it likes to take member initializer lists and pack them into
> as few lines as possible.
>
Note that this is solvable.  Put a comma at the end of your initializer
list, always.  This works for enums, array initializers, and AFAIK just
arbitrary cases of comma separated things between curly braces.  I
personally think that it's absolutely ridiculous that this "hack" exists
and that there is no proper clang-format style option, but then again..  I
haven't proposed or contributed a fix, so I'm not exactly helping.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20200630/c85770cf/attachment.html>


More information about the llvm-dev mailing list