*
The moose likes IDEs, Version Control and other tools and the fly likes Checkstyle Plugin for Eclipse Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Engineering » IDEs, Version Control and other tools
Bookmark "Checkstyle Plugin for Eclipse" Watch "Checkstyle Plugin for Eclipse" New topic
Author

Checkstyle Plugin for Eclipse

Freddy Wong
Ranch Hand

Joined: Sep 11, 2006
Posts: 959

Anyone knows if there is an Eclipse plugin that can format the code according to the Checkstyle rules? The Eclipse plugin that I have now can only generate a report for the list of violations. Thanks in advance.


SCJP 5.0, SCWCD 1.4, SCBCD 1.3, SCDJWS 1.4
My Blog
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14687
    
  16

I don't know. But Google's first result was : http://eclipse-cs.sourceforge.net/


[My Blog]
All roads lead to JavaRanch
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Just set up the Eclipse formatting to match whatever rules you use in Checkstyle.

Jalopy can also be used, although I don't know if there's still a plugin for that anymore.
Freddy Wong
Ranch Hand

Joined: Sep 11, 2006
Posts: 959


I don't know. But Google's first result was : http://eclipse-cs.sourceforge.net/

Yes, that plugin is the one that I use. It can tell all the violations of Checkstyle rule, but it's unable to format it according to Checkstyle rule. I guess I need to do what David said. Create a formatter that formats according to Checkstyle rule.

Anyway, thanks all for the replies
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5823
    
    7

I turn off the formatting checks in CheckStyle and use the Eclipse formatting to determine what the formatting should be. Then I don't have to worry about setting them both to the same thing.

I constantly CTRL-SHIFT-F to reformat. I am ambivalent on the reformat-on-save option, I have some intricately formatted comments, or code/comment combinations, that I don't want touched - sure wish there was as tag, such as <pre> that I could use to tell the Eclipse formatter to not reformat a certain section fo a file - that I would turn on reformat-on-save.


JBoss In Action
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

But with Checkstyle rules you can incorporate formatting/naming/etc. rules into a CI machine.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Checkstyle Plugin for Eclipse