[Kmymoney-devel] astyle problems continue

Thomas Baumgart thb at net-bembel.de
Fri Jan 27 20:15:19 UTC 2012


Hi,

on Friday 27 January 2012 15:08:00 Allan wrote:

> On 27/01/12 13:54, Allan wrote:
> > On 27/01/12 11:55, Allan wrote:
> >>>> Be aware that there is a second step that is run after the astyle
> >>>> command did
> >>>> its thing. The comment in astyle.sh says:
> >>>> 
> >>>> # process the same set of files to replace "foreach(" with "foreach ("
> >>>> 
> >>>> which is exactly what is done. Now if you run the script again, astyle
> >>>> changes
> >>>> "foreach (" into "foreach(" and the wrapper script changes it back.
> >>>> That is
> >>>> why you see a change each time you run the script.
> >> 
> >> Being useless with scripting, I thought I'd adapt this to do my
> >> reformatting, so I changed the "foreach" to "for" and tried that. As
> >> expected, all went well. So, next step was to do the "if" statements,
> >> and again that worked. What I didn't expect, though, is that all the
> >> "for" changes were reverted. Try again, and now the "for" is OK, but the
> >> "if" have reverted.
> >> 
> >> I must be missing something, but what? This seems similar to my original
> >> problem.
> >> 
> >> Allan
> > 
> > I've created a new script to deal with badly formatted if, for, and
> > switch commands. I ran it then checked every file in the folder and they
> > had all been formatted as required. I then thought to recheck the
> > foreach commands and found they were all incorrect, in spite of having
> > run astyle several times.
> > 
> > So, I decided to use the kmm script to handle those, and this it did.
> > However, all the previous changes had been reverted - again.
> > 
> > Is it me? Is anyone else using astyle 1.24 successfully?
> > 
> > Allan
> 
> Erm, it seems the options have been changed in 1.24.  '--pad-paren-out'
> seems to help.

I downloaded 1.24, 2.02 and 2.02.1.  Looks like there is a substantial change 
between 1.23 and higher. I think we need to update this to a newer version 
anyway, but want to check a bit more.  This will probably last until after the 
release.

BTW: --pad-header is the option that takes care of the space after 
if/while/for.

-- 

Regards

Thomas Baumgart

GPG-FP: E55E D592 F45F 116B 8429   4F99 9C59 DB40 B75D D3BA
-------------------------------------------------------------
As soon as there is an optimist who discovers a light that does not exist
there is a pessimist who blows it out. (Giovanni Guareschi)
-------------------------------------------------------------
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 225 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kmymoney-devel/attachments/20120127/2c168e0c/attachment.sig>


More information about the KMyMoney-devel mailing list