Re: [Codenarc-user] Codenarc ruleset with Gradle plugin
Brought to you by:
chrismair
From: Chris M. <chr...@ea...> - 2013-04-08 01:40:13
|
>> http://codenarc.sourceforge.net/StarterRuleSet-AllRulesByCategory.groovy.txt >> Is there a xml version of the above ruleset? os is there any other workaround? No, only Groovy DSL rulesets are provided; the Groovy DSL is definitely more flexible and preferred. And, as a side note, those "starter" all-rule rulesets are not really intended to be used as-is. They contain every rule, including a bunch that you may not want to enforce in your organization, as well as several (generic) rules that require custom configuration in order to do anything useful. Those rulesets are really just a starting point. But one thing you can do as a workaround is create an XML ruleset that just includes the groovy ruleset. The <ruleset-ref> element can refer to a Groovy DSL ruleset. An XML ruleset file something like this should work: <ruleset xmlns="http://codenarc.org/ruleset/1.0" xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance xsi:schemaLocation="http://codenarc.org/ruleset/1.0 http://codenarc.org/ruleset-schema.xsd" xsi:noNamespaceSchemaLocation="http://codenarc.org/ruleset-schema.xsd"> <ruleset-ref path='http://codenarc.sourceforge.net/StarterRuleSet-AllRulesByCategory.groo vy.txt'/> </ruleset> See http://codenarc.sourceforge.net/codenarc-creating-ruleset.html for more information. Chris |