Re: [Codenarc-developer] UnusedMethodParameterRule - ignore main() method
Brought to you by:
chrismair
From: Chris M. <chr...@ea...> - 2011-11-02 00:56:34
|
Hamlet, For UnusedMethodParameter, I tightened up the logic to ignore main() methods. Through experimentation in both Eclipse and IDEA, I discovered that In Groovy, the main() method does not have to specify void return type or String[] args type. But it must be static, with one parameter. I also renamed the 'categoryClassRegex' property to 'ignoreClassRegex'. If you object, I can undo that. Re: Regex versus wildcard patterns, I still think I prefer the wildcard patterns for lists of names, and regex for specs. But I don't think it is a big deal. I think we can support both approaches, at the risk of some minor inconsistencies. Thanks. Chris -----Original Message----- From: Hamlet DArcy [mailto:ham...@ca...] Sent: Monday, October 31, 2011 1:46 AM To: Chris Mair Cc: cod...@li... Subject: Re: [Codenarc-developer] UnusedMethodParameterRule - ignore main() method I think in this case I would just hard code the rule not to error on "public static void main(String[] args)" methods. If you do add a property, then you might as well make it a regex. That has been my thinking... just make it a regex unless there is a good reason not to. ----- Original Message ----- > > > > > Hamlet, > > > > Running CodeNarc snapshot against my projects at work, I am getting > violations for UnusedMethodParameterRule on main () methods. I think > it should ignore those methods by default. > > > > My first instinct would be to introduce a ignoreMethodNames property > (defaulted to ‘main’) on that rule, consistent with the Naming, Size > and other existing rules. But you seem to prefer regex. Do you have an > opinion in this case? Or I guess we could hard-code it to just ignore > main (). > > > > Chris > ---------------------------------------------------------------------- > -------- Get your Android app more play: Bring it to the BlackBerry > PlayBook in minutes. BlackBerry App World™ now supports > Android™ Apps for the BlackBerry® PlayBook™. Discover > just how easy and simple it is! http://p.sf.net/sfu/android-dev2dev > > _______________________________________________ > Codenarc-developer mailing list > Cod...@li... > https://lists.sourceforge.net/lists/listinfo/codenarc-developer > |