[Codenarc-user] Picking up codenarc.properties from Ant task
Brought to you by:
chrismair
From: Steven S. <sp...@gm...> - 2011-08-15 15:04:14
|
Hi all, Many thanks for this great tool, we're using it in our Jenkins CI environment with the violations plugin for nice reporting on possible defects. However, I'm having an issue with not being able to disable some rules that we don't particularly care about, and is causing errors to be reported that we just want to ignore. Given a codenarc.properties file, located in the project root (a grails application) with the following contents: ExplicitArrayListInstantiation.enabled=false and this build.xml -- <project name="myProject"> <taskdef name="codenarc" classname="org.codenarc.ant.CodeNarcTask" /> <target name="codenarc"> <codenarc ruleSetFiles="rulesets/basic.xml, rulesets/braces.xml, rulesets/imports.xml, rulesets/unused.xml" maxPriority1Violations="0"> <fileset dir="src" includes="**/*.groovy" /> <fileset dir="grails-app" includes="**/*.groovy" /> <fileset dir="test" includes="**/*.groovy" /> <report type="xml"> <option name="outputFile" value="test/reports/CodeNarcAntReport.xml" /> </report> <report type="html"> <option name="outputFile" value="test/reports/CodeNarcAntReport.html" /> <option name="title" value="project Groovy Code Analysis" /> </report> </codenarc> </target> </project> ...I am still getting errors about this explicitly instantiating arraylists. I'm unsure how to get the codenarc.properties file to be "picked up" by CodeNarc. I would use the Grails CodeNarc plugin, but unfortunately it's for Grails 1.3+ and this project is Grails 1.1 based. Any pointers or advice would be greatly appreciated. Regards, Steven Sproat -- -- Steven Sproat, BSc http://www.whyteboard.org/ |