Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Checkstyle

 
Robert Hicks
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am using Checkstyle with the Eclipse IDE. Has anyone created a checkstyle based on the JavaRanch style guide?
 
Dirk Schreckmann
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to JavaRanch, Robert!
For those not familiar with Checkstyle, it's a project at Sourceforge.net.
I'm moving this thread to the IDEs and Other Tools forum...
 
Dirk Schreckmann
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Has anyone created a checkstyle based on the JavaRanch style guide?
I just did a quick search on this forum for "checkstyle" and it doesn't appear that anybody has done such a thing. (Note that the search page link is at the top right of this page.)
Are you thinking of doing just that? If so, I'd bet that a few Ranchers would be glad to have it, including a few over on the Cattle Drive. Also, I'm sure it would make for an interesting read and a nice thing to learn about if you were to perhaps write an article or two on the subject for the JavaRanch Journal. Let me know if you do write such a thing.
-Dirk
dirk@javaranch.com
 
ofer misk
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi there!
im just learnning the CheckStyle tool and i have some questions of my own...
i created a Check, and i dont have a clue of how to integrate it to the tool.
should i use Ant? is there some magic in the eclipse that can make such integration?
thanks
 
Lasse Koskela
author
Sheriff
Posts: 11962
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The eclipse integration only provides a way to launch Checkstyle from a graphic UI (and how to display results in the same). In order to integrate a custom check, you need to integrate it into Checkstyle itself.
Based on a quick glance at the documentation, it seems that you need to first include the custom check implementation into your classpath and then declare the check in a configuration file of some sort.
 
ofer misk
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
sorry about the nagging, but im kinda lost in here...
the Check is in my classPath, and i wrote the configuration file, i guess i dont fully understand the situation...
thanks anyway
p.s - if you have a nice integration tutorial, ill be more than greatfull!!!
 
Lasse Koskela
author
Sheriff
Posts: 11962
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you don't get an answer from this forum, you might want to consider searching the particular plugin's "official" forum (is there is one). I have no experience at all with custom checks so I can't help you on the specifics.
 
ofer misk
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks anyway
 
Robert Hicks
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There are a couple of plugins for eclipse. The one I use is called...ta da...Checkclipse. Which prompted my original post.
 
ofer misk
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yes, i got one of the plugins, i wrote my check and xml config file, but each time i try to import the checkstyle configuration i wrote (my xml) to the checkstyle checkset i get an exception : "checkstyleException: unable to load class for rule...".
any idea?
thanks
 
Robert Hicks
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by ofer misk:
yes, i got one of the plugins, i wrote my check and xml config file, but each time i try to import the checkstyle configuration i wrote (my xml) to the checkstyle checkset i get an exception : "checkstyleException: unable to load class for rule...".
any idea?
thanks

You have to go into your XML file and comment out that class rule. Checkclipse does not support "all" of the Checkstyle rules.
 
ofer misk
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yes, but the rule i should exclude is the rule i wrote with blood .
im trying to integrate a new rule..
can you send an example ?
thanks ...
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic