org.codenarc.ruleset
[Groovy] Class PropertiesFileRuleSetConfigurer
java.lang.Object
org.codenarc.ruleset.PropertiesFileRuleSetConfigurer
class PropertiesFileRuleSetConfigurer
Reads the properties file named "codenarc.properties", if found on the classpath, and applies
the property values to matching Rules within a specified RuleSet
. If the
properties file is not found on the classpath, then do nothing.
The default name of the properties file ("codenarc.properties") can be overridden by setting
the "codenarc.properties.file" system property to the new filename. Note that the new filename
is still relative to the classpath, and may optionally contain (relative) path components (e.g.
"src/resources/my-codenarc.properties").
For each properties entry of the form [rule-name].[property-name]=[property-value]
,
the named property for the rule within the RuleSet matching rule-name is set to the
specified property-value. Properties entries not of this form or specifying rule
names not within the specified RuleSet are ignored.
- Authors:
- Chris Mair
- Version:
- \$Revision: 307 \$ - \$Date: 2010-03-28 20:49:57 -0400 (Sun, 28 Mar 2010) \$
Method Summary |
void
|
configure(RuleSet ruleSet)
Configure the rules within the RuleSet from the properties file (relative to the classpath).
|
defaultPropertiesFilename
protected def defaultPropertiesFilename
-
configure
void configure(RuleSet ruleSet)
- Configure the rules within the RuleSet from the properties file (relative to the classpath).
The default properties filename is "codenarc.properties", but can be overridden by setting the
"codenarc.properties.filename" system property.
Each properties entry of the form
[rule-name].[property-name]=[property-value]
is used to set the named property of the named rule. Other (non-matching)
property entries are ignored.
- Parameters:
ruleSet
- - the RuleSet to configure; must not be null
Groovy Documentation