Re: [Codenarc-developer] created a codenarc create-rule target
Brought to you by:
chrismair
From: Hamlet D'A. <ham...@gm...> - 2010-05-24 06:33:12
|
> (1) If the script file was named "codenarc.groovy" instead of "codenarc", > that would allow Windows users (who have the .groovy file association setup) > to run it by just executing "codenarc". But I guess that would make it more > verbose for unix users. Is there a good compromise? I really want it to parallel grails and griffon as much as possible. So "codenarc create-rule" is the preference. However, the script to execute is very, very simple. Perhaps we should rename "codenarc" to "codenarc.groovy" and then provide a ./bin/codenarc and ./bin/codenarc.bat. That sounds like overengineering though. My other idea was to make it a maven target. We're already pretty tied to Maven. "mvn create-rule" might be good as well. > (2) Should the "template" folder be under "src"? I'm not really sure what > the right answer is -- it could be argued that they are "source" files. :) speaking of Maven, it is very Maven-y to think of source files having a correct place to be. Put them wherever you want! -- Hamlet D'Arcy ham...@gm... On Mon, May 24, 2010 at 3:52 AM, Chris Mair <chr...@ea...> wrote: > Hamlet, > > That is very cool! A wonderful enhancement. I have pulled it into the SVN > trunk. I added a return() on line 7 to avoid an > ArrayIndexOutOfBoundsException on line 10 (just an annoyance when no > parameters are specified). > > I have a couple questions: > (1) If the script file was named "codenarc.groovy" instead of "codenarc", > that would allow Windows users (who have the .groovy file association setup) > to run it by just executing "codenarc". But I guess that would make it more > verbose for unix users. Is there a good compromise? > > (2) Should the "template" folder be under "src"? I'm not really sure what > the right answer is -- it could be argued that they are "source" files. > > It will be a little challenging to write proper tests for that script, but I > may take a shot at that. > > Thanks very much. > Chris > -----Original Message----- > From: Hamlet D'Arcy [mailto:ham...@gm...] > Sent: Sunday, May 23, 2010 2:19 AM > To: Cod...@li... > Subject: [Codenarc-developer] created a codenarc create-rule target > > > Hi all, > > I just submitted a patch, and I think it will be really useful. > > I want creating rules to be easier and not have to copy and paste > boilerplate. My intent is to be able to create a new rule live on stage at > some upcoming conferences. > > The patch is attached to: > https://sourceforge.net/tracker/?func=detail&atid=1126575&aid=3005873&group_ > id=250145 > > On Unix/Mac, you can run the following from the project: > > ./codenarc create-rule > > You will enter a rule name and be prompted to select a category. > > Then the base rule, rule test, ruleset xml, and properties will all be > created/updated for you. All you have to do is override a method in your > AstTransfromation and update the unit test. > > Windows users can run > groovy codenarc create-rule > > Let me know how it works. > > -- > Hamlet D'Arcy > ham...@gm... > > ---------------------------------------------------------------------------- > -- > > _______________________________________________ > Codenarc-developer mailing list Cod...@li... > https://lists.sourceforge.net/lists/listinfo/codenarc-developer > > |