[Kmymoney-devel] astyle problems continue

Allan agander93 at gmail.com
Fri Jan 27 20:29:03 UTC 2012

On 27/01/12 20:15, Thomas Baumgart wrote:
> 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.

I started reading the options from the bottom, decided that 
'--pad-paren-out' looked good, tried it and it did fix the problem.

Now, looking elsewhere, and more closely, I can see another run is 
needed, with the next option up from where I stopped reading.

Anyway, at least there's some progress, and less mystification.


More information about the KMyMoney-devel mailing list