[Development] Resolving coding style contentions

Frederik Gladhorn Frederik.Gladhorn at qt.io
Thu Nov 22 10:30:01 CET 2018


Please test the clang-format file we have:
https://code.qt.io/cgit/qt/qt5.git/tree/_clang-format

It's in qt5.git and the CI is smart enough not to run any tests when changing 
only the format file, so please contribute to it, if you think it's not good 
enough. I had to configure Creator to base things on a file, from there on it 
worked nicely. Although I'd prefer a mode where it only formats changed lines 
instead of everything.

Then there is git clang-format which should re-format only the changes you are 
making while contributing. I'd like to see that integrated as at least a hint 
in either the sanity bot or a new bot.
In addition we should have a commit hook, anyone volunteering to write one 
will have my full support.

I have to agree though that some of the re-flowing and other details of clang-
format are far from perfect in my opinion. If anyone did the work for 
Uncrustify instead and showed that it creates more happiness than clang-
format, I would support that too. Does Uncrustify support ranges so it will 
only re-format the parts of a file that were touched?

So please give either tool a chance and let's see if we can reach consensus. 

Cheers,
Frederik

In the meantime I'll enjoy the meta bike-shed and wonder if we should create 
an abstraction layer on top :P






More information about the Development mailing list