|
From: Paul F. <pj...@wa...> - 2023-04-18 06:48:38
|
On 18-04-23 05:41, Eyal Soha wrote:
> The problem with doing this is that it really messes with the git blame,
> introducing a lot of changes!
>
> If you do this, you should probably add some sort of formatting check to
> a CI process somewhere, otherwise your work will get stale and you'll
> just be doing the clang-format again in a year from now.
My goal would be to have some sort of git trigger that maintains formatting.
> Good luck to you trying to get everyone to agree on a format! Ha!
I think that there the battle is mostly won. There are informal "house
rules" and most of the code is 3 space indented with cuddle braces.
There is still a bit of variation (e.g., whether braces indent after
switch or not).
It is also possible to 'protect' blocks of code from clang-format e.g.,
int formatted_code;
// clang-format off
void unformatted_code ;
// clang-format on
(copied from https://clang.llvm.org/docs/ClangFormatStyleOptions.html)
A+
Paul
|