-
Notifications
You must be signed in to change notification settings - Fork 136
Open
Description
Description
The latest milestone of the Spock framework has added a couple of annotation-driven AST transforms that started causing CodeNarc warnings if an enhanced ruleset is used (see original issue). The issue does not seem to be Spock-related, as I was able to reproduce it in a standalone project that has a no-op annotation transform. We'd appreciate your input on what may be causing this issue and if there is any workaround we can apply apart from removing the enhanced ruleset.
How to reproduce
- Check out https://github.com/pshevche/spock-reproducers/tree/main/issue-2149_codenarc-enhanced-rules-ast-transform
- Run
./gradlew :lib:codenarcTest --rerun-tasks - Observe that the output contains the following warning (Build Scan):
WARNING: Compilation error for non-default compiler phase (semantic analysis). Consider removing "enhanced" rules from your ruleset.
Compilation failed for [CustomCompilerPhaseSourceDecorator[SourceFile[/Users/pshevche/dev/spock-reproducers/issue-2149_codenarc-enhanced-rules-ast-transform/lib/src/test/groovy/org/example/SomeTest.groovy]]; phase=4 (semantic analysis)]; org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
None: Could not find class for Transformation Processor org.example.transform.DummyTransform declared by org.example.transform.ApplyDummyTransform
Analysis
I have stumbled upon this issue groovy/groovy-eclipse#270 in groovy-eclipse, where a similar issue was reported. I followed the recommendation from that issue and moved the transformation processor to a new module, but that did not help. The warning was still emitted.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels