views:

439

answers:

5

We are working on a legacy system(7 years old), with lots of java/jsp files that have never been formatted before, not reader at all. Because we have many old versions, we are afraid that we won't be able to effectively diff unformatted and formatted files anymore if we format them.

Question is: are there any command line format tools available with which we can format the old version of the file before doing diff on the new?

Thx

+1  A: 

http://checkstyle.sourceforge.net/cmdline.html has commanline tool.

Dev er dev
Does checkstyle also do formatting? My understanding is that it simply *checks* the style to make sure it's some format, it doesn't actually do any formatting itself, which means it's useless here.
SCdF
A: 

Both Eclipse and IntelliJ have ignore-whitespace options in their diff viewers.

sblundy
A: 

I thought checkstyle only report error, will it really format file?

+1  A: 

It's been a while, but we used to use Jalopy. I'm fairly certain you can run it from the command line.

Patrick Cuff
A: 

Perhaps Artistic Style will work for you.

I have also Uncrustify in my bookmarks, never used it.

PhiLho