configure checks per fileset

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

configure checks per fileset

Jan Groth
all,

I'm struggling with the configuration of different filesets per check. What I'd like to achieve is the following configuration of the JavadocMethod module

(1) -> All classes ending on "Service" need all public methods commented

or, even better:

(2) -> (1) + no comments needed if public method starts with "get" or "set"

Is that actually possible with Checkstyle? Can someone give me a hint?

cheers,
Jan



------------------------------------------------------------------------------
The Palm PDK Hot Apps Program offers developers who use the
Plug-In Development Kit to bring their C/C++ apps to Palm for a share
of $1 Million in cash or HP Products. Visit us here for more details:
http://p.sf.net/sfu/dev2dev-palm
_______________________________________________
Checkstyle-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/checkstyle-user
Reply | Threaded
Open this post in threaded view
|

Re: configure checks per fileset

Jesus M. Rodriguez
On Tue, Aug 3, 2010 at 7:48 AM, Jan Groth <[hidden email]> wrote:
> all,
>
> I'm struggling with the configuration of different filesets per check. What
> I'd like to achieve is the following configuration of the JavadocMethod
> module

The way we handled it in our project was to run checkstyle task for
each fileset using variable definitions in the checkstyle.xml file

For example, our main code had more strict rules than our test code.

Here's our checkstyle.xml: http://bit.ly/cYRB97

And the ant task in our build.xml : http://pastie.org/1072820

Hope that helps.

jesus rodriguez

------------------------------------------------------------------------------
The Palm PDK Hot Apps Program offers developers who use the
Plug-In Development Kit to bring their C/C++ apps to Palm for a share
of $1 Million in cash or HP Products. Visit us here for more details:
http://p.sf.net/sfu/dev2dev-palm
_______________________________________________
Checkstyle-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/checkstyle-user
Reply | Threaded
Open this post in threaded view
|

Re: configure checks per fileset

Jan Groth
Jesus,

thanks for the quick reply :-)

I'm looking for a solution which works with the Eclipse-Checkstyle plugin as well as with Hudson CI. Having one single checkstyle configuration file (and running it once) would be a way better in terms of tools support and real-time feedback for the developers.

I was hoping that it's somehow possible to have different filesets beeing processed differently in just one file (like adding more than one treewalker-module for example?)

cheers,
Jan


On Tue, Aug 3, 2010 at 2:52 PM, Jesus M. Rodriguez <[hidden email]> wrote:
On Tue, Aug 3, 2010 at 7:48 AM, Jan Groth <[hidden email]> wrote:
> all,
>
> I'm struggling with the configuration of different filesets per check. What
> I'd like to achieve is the following configuration of the JavadocMethod
> module

The way we handled it in our project was to run checkstyle task for
each fileset using variable definitions in the checkstyle.xml file

For example, our main code had more strict rules than our test code.

Here's our checkstyle.xml: http://bit.ly/cYRB97

And the ant task in our build.xml : http://pastie.org/1072820

Hope that helps.

jesus rodriguez

------------------------------------------------------------------------------
The Palm PDK Hot Apps Program offers developers who use the
Plug-In Development Kit to bring their C/C++ apps to Palm for a share
of $1 Million in cash or HP Products. Visit us here for more details:
http://p.sf.net/sfu/dev2dev-palm
_______________________________________________
Checkstyle-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/checkstyle-user


------------------------------------------------------------------------------
The Palm PDK Hot Apps Program offers developers who use the
Plug-In Development Kit to bring their C/C++ apps to Palm for a share
of $1 Million in cash or HP Products. Visit us here for more details:
http://p.sf.net/sfu/dev2dev-palm
_______________________________________________
Checkstyle-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/checkstyle-user
Reply | Threaded
Open this post in threaded view
|

Re: configure checks per fileset

Jesus M. Rodriguez
On Tue, Aug 3, 2010 at 9:23 AM, Jan Groth <[hidden email]> wrote:
> Jesus,
>
> thanks for the quick reply :-)
>
> I'm looking for a solution which works with the Eclipse-Checkstyle plugin as
> well as with Hudson CI. Having one single checkstyle configuration file (and
> running it once) would be a way better in terms of tools support and
> real-time feedback for the developers.

For  eclipse, I use the Checkstyle plugin as well. I had to create 2
different profiles.
In the checkstyle plugin: Local Check Configurations area. I created 2 entries:
projectname-src-checkstyle and projectname-test-checkstyle.

Click on the Properties button and point it to your checkstyle.xml file.
Then click the 'Additional properties...' button to define the variables
for this particular configuration. The same ones I defined in my build.xml.

Once I had my local configurations defined, in the Main tab I was able
to create 2 filesets one called main the other test. There I selected
the files I wanted checked by each one.

This allows me to have 2 different rulesets defined by a single checkstyle.xml.
It works great (once it is setup).

>
> I was hoping that it's somehow possible to have different filesets beeing
> processed differently in just one file (like adding more than one
> treewalker-module for example?)

Probably not. You're best bet would be to define properties for elements
that can be controlled by properties. I control the following based on
variables:
checkstyle.cache.file
checkstyle.header.file
javadoc.lazy
javadoc.method.scope
javadoc.missing.param
javadoc.type.scope
javadoc.var.scope

So you might be able to change the scoping rules of your methods and javadoc
using properties.

If you find a better solution please post it back to the list. I'd be
interested in a better
way.

jesus

------------------------------------------------------------------------------
The Palm PDK Hot Apps Program offers developers who use the
Plug-In Development Kit to bring their C/C++ apps to Palm for a share
of $1 Million in cash or HP Products. Visit us here for more details:
http://p.sf.net/sfu/dev2dev-palm
_______________________________________________
Checkstyle-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/checkstyle-user