lilypond-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

GOP2-4 - C++ and scheme indentation (probable decision)


From: Graham Percival
Subject: GOP2-4 - C++ and scheme indentation (probable decision)
Date: Thu, 16 Aug 2012 21:42:38 +0100
User-agent: Mutt/1.5.21 (2010-09-15)

Two developers didn't seem fond of this idea, but other people
liked it, so it's not changed significantly.
http://lilypond.org/~graham/gop/gop_5.html


** Proposal summary

C++ will remain as-is, using astyle 2.02 (not astyle2.02.1) with
scripts/auxiliar/fixcc.py

Scheme will be indented with a yet-to-be written
scripts/auxiliar/fix-scheme.sh, which does the same thing as
emacs.

There should be no tabs in any C++ or scheme files. Emacs users
are asked to adjust their editors or add something to the lilypond
git repository so they don’t replace spaces with tabs.


** Motivation

New contributors sometimes struggle to follow our indentation and
code style – this is especially difficult when parts of our
existing source code doesn’t have a consistent style. This is
problematic... we want new contributors to be struggling with the
lilypond architecture, not playing games in their text editors!

We discussed this last year, but it didn’t quite turn into a
patch. This led to yet another round of disheartening confusion
for a well-intentioned new contributor, i.e.
        
http://codereview.appspot.com/5343050/#msg5
http://codereview.appspot.com/5320074

A large part of the confusion stemmed from git-cl and rietveld,
but it’s still sad to see people losing time due to the lack of
consistent formatting in our source code.

Emacs is not an answer; nobody wants to install 50 megabytes just
to format scheme code. Especially when a standalone tool could do
the job in probably less than 10 Kb.


** Proposal details

C++ is unchanged. Astyle 2.02.1 changes the formatting in some
way, but I haven’t looked at the details and don’t feel like
arguing about this again.

Scheme will be based on:
        
http://codereview.appspot.com/4896043/

after making the fixes that Neil identified.


** Desired indentation style

There is a request that the script format scheme files like emacs
does. I am not aware of any objections to this, so let’s try to
make it so. (if there’s disagreement between different version of
emacs, I guess we pick the later version to imitate?)


** Implementation notes

The C++ change went quite well, and we have far fewer outstanding
patches for scheme code. No major problems anticipated.

It’s easy to be pessimistic that this will never be done because
nobody has finished off the last 1-2 hours on this script in the
past year. I’m hoping that I can guilt-trip David into doing this
with me when I visit at the end of August – if I spend most of a
day on two airplane flights, one train, and one subway (and then
the same to return!) then hopefully we can spend a tenth of that
time fixing scheme indentation in lilypond.

We will not manually specify what the scheme files should look
like as part of this proposal; just run that script on your files.
Interested parties may add an unofficial description of the scheme
indentation to the CG if they are interested.

Indenting C++ and scheme files is an occasional maintenance task
that Graham will do occasionally. 


- Graham



reply via email to

[Prev in Thread] Current Thread [Next in Thread]