[Development] Resolving coding style contentions

Matthew Woehlke mwoehlke.floss at gmail.com
Wed Nov 21 21:27:14 EET 2018


On 21/11/2018 14.11, Ville Voutilainen wrote:
> On Wed, 21 Nov 2018 at 19:51, Matthew Woehlke wrote:
>> On 20/11/2018 03.28, Lars Knoll wrote:
>>> I suggest that we stop arguing about coding styles by defining one
>>> through a tool (aka clang-format and one format file for all of Qt).
>>
>> Ugh... clang-format is only okay if you want LLVM's code style, and it
> 
> It has been used successfully in projects that don't use LLVM's style.

Really? When I looked into using it for one of my work projects, it was
hopelessly unconfigurable and was going to necessitate switching to a
significantly different code style than what most of the code was using.

Okay, pedantically, LLVM *or Google*, or I think there are maybe 1-2
other styles it supports... However, if what you want deviates from
those presents, your choices are either a) too bad, change the code
style of your entire source base, or b) don't use clang-format.
Clang-format simply doesn't have the configurability to support anything
beyond its "blessed styles" with a very small number of possible tweaks.

I haven't looked into whether Qt's is one of those "blessed styles". If
it is... fine, whatever. If it isn't, uncrustify can almost certainly
produce whatever style Qt wants, which is a claim clang-format most
certainly can't make.

(Besides, for me, the whole reflow thing was sort of a deal-killer.)

BTW, does clang-format know how to correctly style old-style SIGNALS/SLOTS?

-- 
Matthew


More information about the Development mailing list