[Development] Resolving coding style contentions

Elvis Stansvik elvstone at gmail.com
Thu Nov 22 10:45:50 CET 2018


Den tors 22 nov. 2018 kl 10:31 skrev Frederik Gladhorn
<Frederik.Gladhorn at qt.io>:
>
> 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

Don't forget that always when a project starts discussing
auto-formatting, there also needs to be a big discussion about whether
to do a mass formatting :) With one camp usually vehemently against it
due to the destruction of git blame and the destruction of carefully
aligned `//` comments et.c., and the other camp thinking it worth it
because of the consistency it brings. So you'll have plenty to enjoy
:)

Elvis

>
>
>
> _______________________________________________
> Development mailing list
> Development at lists.qt-project.org
> https://lists.qt-project.org/listinfo/development



More information about the Development mailing list