[Qt-creator] Tabs vs Spaces?

Miller Henry MillerHenry at JohnDeere.com
Fri Mar 6 18:04:06 CET 2020


The obvious thing is to create a clang-format rule that formats things to your preferences, and then back to the repo preferences.  A git hook can reformat files to the repo preferences before you check them in, though I'm not sure how you reformat to your preferences. Beware that if you do this you need to get everybody to agree to the repo format and run the tool before their checkins as well, otherwise 'git blame' will put your name on most of the code when your only contribution was to change whitespace to what it should have been in the first place.

Clang-format is the best-known tool for this today. I've also used uncrustify in the past for formatting, and I've seen a few other tools.  Your project can choose.

-----Original Message-----
From: Qt-creator <qt-creator-bounces at qt-project.org> On Behalf Of Jason H
Sent: Friday, March 6, 2020 10:38 AM
To: qt-creator <qt-creator at qt-project.org>
Subject: [Qt-creator] Tabs vs Spaces?

I am a tabs guy. I change the Qt style to use tabs. I tab all the things!!

Anyway, I now have other contributors to my project that are spaces people. How can we live in harmony? One side effect is that it seems git considers whitespace changes so his code is indented with spaces, mine are tabs and it's making a mess in git.


Or should this be handled by git? (And if so, how?)


_______________________________________________
Qt-creator mailing list
Qt-creator at qt-project.org
https://lists.qt-project.org/listinfo/qt-creator


More information about the Qt-creator mailing list