Re: [Codenarc-developer] created a codenarc create-rule target
Brought to you by:
chrismair
From: Chris M. <chr...@ea...> - 2010-05-24 01:52:28
|
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 |