14.6.4.3 GOP-PROP 3 - C++ formatting

Speaking academically, C++ code style is a "solved problem". Let’s pick one of the existing solutions, and let a computer deal with this. Humans should not waste their time, energy, and creativity manually adding tabs or spaces to source code.

We have modified fixcc.py to use astyle, along with extra regex tweaks.

GNU code

LilyPond is a GNU project, so it makes sense to follow the GNU coding standards. These standards state:

We don’t think of these recommendations as requirements, because it causes no problems for users if two different programs have different formatting styles.

But whatever style you use, please use it consistently, since a mixture of styles within one program tends to look ugly. If you are contributing changes to an existing program, please follow the style of that program.

(http://www.gnu.org/prep/standards/html_node/Formatting.html)

With that in mind, we do not think that we must blindly follow the formatting given by the currrent version of Emacs.

Implementation notes

We can avoid some of the style change pollution in git history by ignoring whitespaces changes:

git diff -w

Discussions

 
https://lists.gnu.org/archive/html/lilypond-devel/2011-06/msg00526.html
https://lists.gnu.org/archive/html/lilypond-devel/2011-06/msg00796.html
https://lists.gnu.org/archive/html/lilypond-devel/2011-07/msg00200.html
https://lists.gnu.org/archive/html/lilypond-devel/2011-07/msg00525.html
https://lists.gnu.org/archive/html/lilypond-devel/2011-07/msg00751.html
https://lists.gnu.org/archive/html/lilypond-devel/2011-07/msg00751.html

LilyPond — Contributor’s Guide v2.19.12 (development-branch).