[libcxx-commits] [PATCH] D124789: [libc++] Find a clang-format everybody is happy with
Eric Fiselier via Phabricator via libcxx-commits
libcxx-commits at lists.llvm.org
Mon Jun 13 15:57:33 PDT 2022
EricWF requested changes to this revision.
EricWF added a comment.
This revision now requires changes to proceed.
In D124789#3579867 <https://reviews.llvm.org/D124789#3579867>, @ldionne wrote:
> This is not perfect, but it looks reasonable to me. However, some comments;
> 1. Let's keep it soft-fail for a bit until we've gained some hands-on experience with formatting our code. We can have a not-yet-enforced expectations that contributors run clang-format, and start enforcing it in 1-2 weeks once everybody has had a bit of experience with it.
> 2. Let's not make changes to actual files in this patch.
> So, basically, let's land the changes to `.clang-format`, give ourselves 2 weeks to get accustomed, and then make it hard-fail in the CI. For the next 2 weeks, there will be a not-CI-enforced-yet expectation that people clang-format their changes. That will let us adjust if needed.
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.
Like all things, the value of a formatting tool, is not found in the extremes of never allowing or always mandating its use.
Instead, it's found in between; only when it's the right tool for the job.
Let's admit that having a clang-format spec is needed so people _can_ use the tool, but in doesn't and shouldn't require that they _must_ use the tool.
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.
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).
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
More information about the libcxx-commits