[Kmymoney-devel] astyle problems continue

Allan agander93 at gmail.com
Fri Jan 27 13:54:57 UTC 2012

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?


More information about the KMyMoney-devel mailing list