[ANN] Announcing CodeNarc 0.12 and Grails CodeNarc Plugin 0.9
The CodeNarc Team is proud to announce the release of version 0.12 and the corresponding update of the Grails CodeNarc Plugin (to version 0.9). CodeNarc is a static analysis tool for Groovy source code. Version 0.12 adds 36 new rules to the product (bringing the total to 160+ rules). Try it out on the CodeNarc web console, running on Google App Engine.
Fix Bug #3109628: "Exceptions are thrown with CodeNarc v0.11" – "GString as map key checking classes that do not exist yet” and “unnecessary ctor rule breaks for anonymous classes".
Potential Breaking Changes
Moved the existing StringInstantiation and BooleanInstantiation rules from the Basic ruleset into the Unnecessary ruleset.Also renamed the rules to UnnecessaryStringInstantiationRule and UnnecessaryBooleanInstantiation.Likewise, the rule classes were moved from the org.codenarc.rule.basic package into org.codenarc.rule.unnecessary.NOTE: This should only affect users if
You configured one of these rules specifically by rule name or by class name within a custom ruleset
You configured one of these rules (by rule name) within "codenarc.properties"
You configured one of these rules (by rule name) within a @SuppressWarnings annotation
You configured one of these rules (by rule name) within "codenarc-message.properties".
Removed deprecated applyToFilenames and doNotApplyToFilenames properties of AbstractRule.
UnnecessaryIfStatementRule: Expand the rule to also catch if/else statements that contain only single constant/literal expressions for the if and/or else blocks, if the if is not the last statement in the block.
Feature #3108153: Expand ReturnNull* rules to catch elvis operators
Feature #3111442: "add better error messages to the ReturnsNull*Rules"
Feature #3111440: "added better violation messages to BigDecimalInstantiationRule, BooleanInstantiationRule, and StringInstantiationRule".
Add isValid() to SourceCode (and AbstractSourceCode).