[libcxx-commits] [PATCH] D124789: [libc++] Find a clang-format everybody is happy with

Mark de Wever via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Tue Jun 14 08:30:14 PDT 2022


Mordante added a comment.

In D124789#3501163 <https://reviews.llvm.org/D124789#3501163>, @philnik wrote:

> Personally I don't see much of a reason to stay close to the LLVM style. We already deviate quite a bit to make the code readable. The libc++ code base is quite different from most of the other LLVM projects. Is there any specific reason you want to stay close to the LLVM style @Mordante?

Consistency in the entire project. I agree that libc++ requires some tweaking but the change I commented on seems not really needed for libc++. I personally prefer the amount of deviation of the LLVM style as small as possible.

In D124789#3579980 <https://reviews.llvm.org/D124789#3579980>, @EricWF wrote:

> Absolutely requiring clang-format on _all_ code is going too far.
>
> Clang-format should be available for contributors to use on their changes, and if they do, reviewers should not ask them to change the formatting.
> But if a human wants to make code more human readable using whitespace, I say all the power too them; they can often out-format the tool.

I agree it's easy to out-format the code manually, but in my experience that out-formatted code quickly bitrots to ugly formatted code. I don't object to manually formatted code as long as we accept clang-formatted code in followup patches and not require all changes to have manual formatting too.

> Nor should we reformat the entire world at once. 
> Let's go slowly, see how it works, and if it does work well, the codebase will get organically  formatted over time.

Agreed.

> In my opinion the VCS blame is far more important than having tool formatted code (especially if we might change the style and reformat more than once).

Note LLVM already has a top-level `.git-blame-ignore-revs` file. So if we decide to do large scale formatting we can still keep git blame working nicely.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D124789



More information about the libcxx-commits mailing list