On 2009-07-12 10:19-0700 Alan W. Irwin wrote:

> What is needed now is a volunteer with a keen eye for C/C++ style issues to
> evaluate uncrustify-0.53 (and the latest versions of the others on the list
> if uncrustify is unsuitable) to find the combination of options which
> enforces the consensus on style that we have reached (i.e., the style
> details mentioned on list by Geoff which all core developers appeared to be
> willing to go along with).  I am tempted to volunteer for this myself
> because I think it is really important to come up with a method of
> converting PLplot source code to a consistent style after all the effort
> that has gone into thinking about the ideal PLplot code style.  However, I
> don't have a keen eye for C/C++ style issues since I am not as experienced
> in those languages as other PLplot developers.  Thus, if I do this I might
> come up with a set of uncrustify options that enforce every style issue that
> Geoff brought up but still leave some "obvious" style issue in the result
> that will require additional work to fix.  Thus, it would probably be best
> if someone else volunteered for this task.

Well, we still need that style-conscious volunteer, but to get the ball
rolling I just committed uncrustify.cfg in the top-level source tree which I
think already does a pretty good job of enforcing the consensus style
we have been discussing.

uncrustify-0.53 has a number of example style files including the default
style, defaults.cfg (which defines some 350 options).  One of those style
files is ben2.cfg which is the favorite style of the author of uncrustify.
It only mentions ~60 options so I assume those are the most
important options, and the code uses defaults.cfg for the rest.  I
edited ben2.cfg to create uncrustify.cfg.

You can run it like this:

~software/uncrustify/install/bin/uncrustify -c uncrustify.cfg -f \
drivers/qt.cpp |less

where the application pathname must point to the (latest) 0.53 version of
uncrustify.  I adjusted uncrustify.cfg following the documentation in
defaults.cfg until the results looked consistent with what was mentioned on
list.  In addition to using less to view stdout, I have also used the
programme to create a local "styled" form of qt.cpp which builds without
issues.

However, when looking at the "styled" source code I noticed that line
breaking on one ugly long line starting with

static DrvOpt qt_options

gives an even uglier (but still correct) result.  I presume it is the
combination of alignment options (which I didn't change from Ben's version)
which need tweaking here.  Anyhow, uncrustify.cfg needs some more work
following the documentation in defaults.cfg (from uncrustify-0.53), and
patches or commits to that effect would be most welcome.

Alan
__________________________
Alan W. Irwin

Astronomical research affiliation with Department of Physics and Astronomy,
University of Victoria (astrowww.phys.uvic.ca).

Programming affiliations with the FreeEOS equation-of-state implementation
for stellar interiors (freeeos.sf.net); PLplot scientific plotting software
package (plplot.org); the libLASi project (unifont.org/lasi); the Loads of
Linux Links project (loll.sf.net); and the Linux Brochure Project
(lbproject.sf.net).
__________________________

Linux-powered Science
__________________________

------------------------------------------------------------------------------
Enter the BlackBerry Developer Challenge  
This is your chance to win up to $100,000 in prizes! For a limited time, 
vendors submitting new applications to BlackBerry App World(TM) will have
the opportunity to enter the BlackBerry Developer Challenge. See full prize  
details at: http://p.sf.net/sfu/Challenge
_______________________________________________
Plplot-devel mailing list
Plplot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/plplot-devel

Reply via email to