[Development] clang-format

Philippe philwave at gmail.com
Tue Jun 19 18:13:41 CEST 2018


> For the above reasons I'd lean towards not running it globally and just using it
> on new changes.

+1, based on my clang-format experience on a big application.

BTW, keep in mind that you can disable clang-format on code sections with:

// clang-format off
// clang-format on

Philippe

On Mon, 18 Jun 2018 12:23:53 +0300
Kari Oikarinen <kari.oikarinen at qt.io> wrote:

> 
> 
> On 18.06.2018 12:04, Frederik Gladhorn wrote:
> <snip>
> 
> Other parts sound good, so I'll just touch on the big question.
> 
>  > And then there is the big question when we run it once over the entire
>  > codebase.
> 
> I'd hesitate to ever run it over the entire codebase.
> 
> * It will ruin plain git blame, since so much will point to that particular
>    commit. Yes, you can use `git blame -w` to avoid whitespace changes, but that
>    does not catch rewrapped lines.
> 
> * Open changes would need to be rebased on top of it. When would be a good point
>    in time with few open changes?
> 
> * Which branch do you run it in? If an early one, there's many merges to do. If
>    a late one, all the subsequent merges are tricky.
> 
> It is quite a bit of pain while the benefit isn't that big. Actively worked on
> areas would shape up incrementally anyway and the other areas are not read that
> much, so the damage of inconsistent formatting is limited.
> 
> For the above reasons I'd lean towards not running it globally and just using it
> on new changes.
> 
> -- Kari
> _______________________________________________
> Development mailing list
> Development at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/development





More information about the Development mailing list