For rules that are subclasses of AbstractAstVisitorRule (most AST-based rules), you can control which classes they apply to using class name patterns.
applyToClassNames: The rule is only applied to classes matching these names.doNotApplyToClassNames: The rule is NOT applied to classes matching these names.
Pattern Rules:
- Supports single names or comma-separated lists.
- Supports wildcards:
* (zero or more characters) and ? (exactly one character). - Can use fully-qualified class names (including package) or simple class names.
Note: These properties are not available for rules handling imports, blank lines, or other file-based elements.
# Do not apply to specific classes regardless of package
CatchThrowable.doNotApplyToClassNames=BaseController,AbstractTest
# Apply only to a specific class or any class in a specific package
FieldName.applyToClassNames=org.codenarc.CodeNarc,org.codenarc.extra.*