|
From: | Etienne M. Gagnon |
Subject: | Re: gcj vs classpath merge status |
Date: | Tue, 29 Jan 2002 14:38:50 -0500 |
User-agent: | Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.7) Gecko/20020121 |
Brian Jones wrote:
You should keep the reformatting separate from a code change if at all possible just so it is more clear in looking at CVS with diff/logs. Is there a mode in standard GNU indent which meets the right formatting criteria for Java code and GNU standards?
GNU indent doesn't handle Java well, unfortunately (at least, the last time I checked). But I have discovered "astyle" http://www.bigfoot.com/~davidsont/astyle which works relatively well. It has supports the GNU style.
Personally, I use the following options, which give preety good results (relatively conform to the GNU style):
astyle -jbs2It has a small glitch; it sometimes adds spurious blank lines, so applying astyle to a file repeatedly adds a block of empty lines. These lines are easily removed by a small program which removes blocks of empty lines [I have written one].
Astyle does't go as far as GNU indent for controling the indentation of code "within" a line of code (e.g. space before parentheses, etc.). But it is much better than nothing!
Etienne -- Etienne M. Gagnon http://www.info.uqam.ca/~egagnon/ SableVM: http://www.sablevm.org/ SableCC: http://www.sablecc.org/
[Prev in Thread] | Current Thread | [Next in Thread] |