Re: [Codenarc-user] Grails plugin - enable all rulessets target?
Brought to you by:
chrismair
From: Hamlet D. <ham...@ca...> - 2011-08-20 04:50:00
|
> I think if people have not specified the ruleset files they want, we > can assume they want the default ones. I agree. I am not proposing we change that. > It is currently only 3 but > you could change the default in a new version of the plugin and > include all the ones you mention. No, this is a bad idea for the reasons you provide. > The problem with your approach is that if you want to promote a new > category (ruleset file), nobody will know about it unless they > happen to read about it and explicitly add it. Let me explain my idea better. If you run "grails install-plugin-codenarc" and "grails codenarc" then it should work 100% like the old version. There are no changes to BuildConfig.groovy. I propose we add a new switch or a new target. You get a new target called "grails codenarc-add-all-rules", and this target updates your BuildConfig.groovy. You could run it today and it would add all the rulessets into your config. Or you could run it after a CodeNarc upgrade and get any new rulesets added to your config. > PS: also, codenarc should be able to recognize when ruleSetFiles is a > collection: users should not have to add ".join(',').toString()".. Is that possible in a .properties file? I think the field needs to be a String. I'm not sure lists are possible in a Java resource bundle. -- Hamlet ----- Original Message ----- > > I think if people have not specified the ruleset files they want, we > can assume they want the default ones. It is currently only 3 but > you could change the default in a new version of the plugin and > include all the ones you mention. If suddenly they get too many > violations, then they will have to ead the doc and explicitly state > the ones they are interested in. > > The problem with your approach is that if you want to promote a new > category (ruleset file), nobody will know about it unless they > happen to read about it and explicitly add it. > > My 2c. > > PS: also, codenarc should be able to recognize when ruleSetFiles is a > collection: users should not have to add ".join(',').toString()".. > > > > On Thu, Aug 18, 2011 at 4:07 AM, Hamlet DArcy < > ham...@ca... > wrote: > > > I am using the Grails plugin. > > By default, only three rulessets are used. I think we should > encourage people to use more of the rulesets. > > What do you think of adding a switch to the codenarc target, like > this: > > grails codenarc -enableAllRulesets > > And when you run this, BuildConfig.groovy has this text appended to > it: > > codenarc.ruleSetFiles=[ > 'rulesets/basic.xml', > 'rulesets/braces.xml', > 'rulesets/concurrency.xml', > 'rulesets/design.xml', > 'rulesets/exceptions.xml', > 'rulesets/formatting.xml', > 'rulesets/grails.xml', > 'rulesets/imports.xml', > 'rulesets/jdbc.xml', > 'rulesets/junit.xml', > 'rulesets/logging.xml', > 'rulesets/naming.xml', > 'rulesets/security.xml', > 'rulesets/serialization.xml', > 'rulesets/size.xml', > 'rulesets/unnecessary.xml', > 'rulesets/unused.xml'].join(',').toString() > > What do you think? Is this a good idea? > -- > Hamlet D'Arcy > ham...@ca... > > > ------------------------------------------------------------------------------ > Get a FREE DOWNLOAD! and learn more about uberSVN rich system, > user administration capabilities and model configuration. Take > the hassle out of deploying and managing Subversion and the > tools developers use with it. http://p.sf.net/sfu/wandisco-d2d-2 > _______________________________________________ > Codenarc-user mailing list > Cod...@li... > https://lists.sourceforge.net/lists/listinfo/codenarc-user > > |