CodeNarc

View: New views
3 Messages — Rating Filter:   Alert me  

CodeNarc

by Paolo DiCanio :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

I'm using CodeNarc to confirm how appallingly awful my Groovy/Grails is. Although CodeNarc enables you to exclude certain classes from being checked by certain rules, I would like a finer level of control. Specifically, is it possible to exclude certain methods, or even certain lines?

When using PMD (a similar Java code analysis tool) you can comment a line with something like "//NOPMD" and PMD will ignore those lines. Does CodeNarc have a similar feature?

Cheers,
Paolo

Re: CodeNarc

by Chris Mair :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


>> I'm using CodeNarc to confirm how appallingly awful my Groovy/Grails is.
LOL!

>> is it possible to exclude certain methods, or even certain lines?
No, there is currently no such facility within CodeNarc. If there is sufficient interest, I could look into supporting something like that. It might get a bit ugly and/or slow -- right now CodeNarc deals mostly with the Groovy AST, and that does not provide access to comments. Annotations would be an option, but you cannot annotate individual lines.

Thanks for the feedback.
Chris


Paolo DiCanio <domurtag@...>

11/04/2009 11:17 AM
Please respond to
user@...

To
user@...
cc
Subject
[groovy-user] CodeNarc



Hi,

I'm using CodeNarc to confirm how appallingly awful my Groovy/Grails is.
Although CodeNarc enables you to exclude certain classes from being checked
by certain rules, I would like a finer level of control. Specifically, is it
possible to exclude certain methods, or even certain lines?

When using PMD (a similar Java code analysis tool) you can comment a line
with something like "//NOPMD" and PMD will ignore those lines. Does CodeNarc
have a similar feature?

Cheers,
Paolo
--
View this message in context: http://old.nabble.com/CodeNarc-tp26199416p26199416.html
Sent from the groovy - user mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

   http://xircles.codehaus.org/manage_email
ourceID:NT000A08D6    

Re: CodeNarc

by Paolo DiCanio :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Thanks for the feedback. Personally I think annotations are a better approach than comments, as I think comments should only be for human consumption, and should not influence the behaviour of tools.

Although annotations would only allow you to exclude certain methods, I think this is probably fine-grained enough for most people.