To CodeNarc users and developers,
The next version of CodeNarc will include some new rules that require a
later compiler phase for the Groovy AST compiler. Instead of the default
CONVERSION phase, these rules will require the later SEMANTIC_ANALYSIS
phase. The benefit is that this will allow these rules to make use of a
richer and more complete Abstract Syntax Tree (AST). The downside is that
the later compiler phase requires CodeNarc to have the application classes
being analyzed, as well as any referenced classes, on the classpath.
NOTE: If a rule requiring a later compiler phase is included in the active
CodeNarc ruleset and enabled and one or more of the required classes is not
on the classpath, then CodeNarc will log a Log4J WARN message for each
source file that contains the missing references.
This new capability was proposed and implemented by Artur Gajowy. See Pull
request #14 <https://github.com/CodeNarc/CodeNarc/pull/14> for details and
discussion.
CodeNarc users that use the Ant Task directly will need to adjust their Ant
scripts to expand the classpath, if they want to take advantage of these
special new rules.
I think that other tools/frameworks that use CodeNarc will not be able to
use these new rules initially, because the tool classpath will not support
it. The hope is that the other CodeNarc tools will eventually be enhanced to
provide the expanded classpath to CodeNarc - either optionally or always -
so that they can also take advantage of these new rules.
We also expect to continue to introduce more of these "special"
enhanced-classpath rules, since that greatly expands the capabilities for
CodeNarc rules.
Anyone who doesn't want to use the new rules or is unable to expand the
classpath as required, can just omit these special rules from the CodeNarc
ruleset or else disable the rules.
Thanks.
Chris
|