Bug 61100

Summary: Provide batch invocation of code formatter
Product: [Eclipse Project] JDT Reporter: David Biesack <David.Biesack>
Component: CoreAssignee: Olivier Thomann <Olivier_Thomann>
Status: RESOLVED DUPLICATE QA Contact:
Severity: enhancement    
Priority: P3 CC: ed.burnette, sflaniga
Version: 3.0   
Target Milestone: 3.2 M5   
Hardware: All   
OS: All   
Whiteboard:

Description David Biesack CLA 2004-05-05 14:56:57 EDT
To help ensure code consistency and standards, it would be very useful if
the source formatter could be invoked in batch. Although a large majority
of our developers are using Eclipse 3.0, some use WSAD (based on 2.1, 
which does not support all the 3.0 format options), others
use other IDE, Emacs etc.  If the formatter could be invoked via the
command line, then we could have consistent formatting across users, which
will result in fewer diffs in our CVS commits.

An important part of a command line formatter would be command line options
to refer to a saved set of format parameters/options.

Although other command line tools exist (jalopy, etc.) the Eclipse formatter
is the most convenient for the widest set of our internal users, so rather
than force Eclipse users to replace the Eclipse formatter with an outside tool,
exposing the Eclipse formatter to other users is our preference.  

A separate feature request addresses invoking the formatter via an API
( 46398 ) as well as 12144 to reformat multiple files in a project,
but I suspect those only work within an active Eclipse session.
Comment 1 Philipe Mulet CLA 2004-05-10 04:52:29 EDT
Post 3.0
Comment 2 Sean Flanigan CLA 2006-02-23 06:01:37 EST
According to New&Noteworthy <http://download.eclipse.org/eclipse/downloads/drops/S-3.2M5-200602171115/eclipse-news-M5.html>, this feature has been added in 3.2M5.

On the other hand, when I tried it, I got an error, with the log message:
java.lang.RuntimeException: Application "org.eclipse.jdt.core.JavaCodeFormatter" could not be found in the registry. N&N mentions a section in the user guide which seems to be missing.  Thus I have the feeling that the feature didn't really make it after all.
Comment 3 Philipe Mulet CLA 2006-02-23 06:14:48 EST
Changes got released for M5.
See bug 75333
Comment 4 Philipe Mulet CLA 2006-02-23 06:15:37 EST
olivier - pls instruct how to use standalone formatter.
Comment 5 Philipe Mulet CLA 2006-02-23 06:15:48 EST

*** This bug has been marked as a duplicate of 75333 ***
Comment 6 Sean Flanigan CLA 2006-02-23 06:23:09 EST
I just discovered that I was in the 3.2M4 directory, not M5 as I thought.  Sorry!