[
https://issues.apache.org/jira/browse/GROOVY-11884?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18069162#comment-18069162
]
ASF GitHub Bot commented on GROOVY-11884:
-----------------------------------------
codecov-commenter commented on PR #2407:
URL: https://github.com/apache/groovy/pull/2407#issuecomment-4146023223
##
[Codecov](https://app.codecov.io/gh/apache/groovy/pull/2407?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
Report
:x: Patch coverage is `86.95652%` with `6 lines` in your changes missing
coverage. Please review.
:white_check_mark: Project coverage is 66.4248%. Comparing base
([`21604a6`](https://app.codecov.io/gh/apache/groovy/commit/21604a6a187427d7d0623f9d5f8d229dbf2867d9?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache))
to head
([`88afe5b`](https://app.codecov.io/gh/apache/groovy/commit/88afe5b28c3b902f4feddc2a514d177c749c217b?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
| [Files with missing
lines](https://app.codecov.io/gh/apache/groovy/pull/2407?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
| Patch % | Lines |
|---|---|---|
|
[...org/codehaus/groovy/classgen/ExtendedVerifier.java](https://app.codecov.io/gh/apache/groovy/pull/2407?src=pr&el=tree&filepath=src%2Fmain%2Fjava%2Forg%2Fcodehaus%2Fgroovy%2Fclassgen%2FExtendedVerifier.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3JjL21haW4vamF2YS9vcmcvY29kZWhhdXMvZ3Jvb3Z5L2NsYXNzZ2VuL0V4dGVuZGVkVmVyaWZpZXIuamF2YQ==)
| 82.6087% | [2 Missing and 2 partials :warning:
](https://app.codecov.io/gh/apache/groovy/pull/2407?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
|
|
[...n/java/org/codehaus/groovy/ast/AnnotationNode.java](https://app.codecov.io/gh/apache/groovy/pull/2407?src=pr&el=tree&filepath=src%2Fmain%2Fjava%2Forg%2Fcodehaus%2Fgroovy%2Fast%2FAnnotationNode.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3JjL21haW4vamF2YS9vcmcvY29kZWhhdXMvZ3Jvb3Z5L2FzdC9Bbm5vdGF0aW9uTm9kZS5qYXZh)
| 90.0000% | [1 Missing and 1 partial :warning:
](https://app.codecov.io/gh/apache/groovy/pull/2407?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
|
<details><summary>Additional details and impacted files</summary>
[](https://app.codecov.io/gh/apache/groovy/pull/2407?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
```diff
@@ Coverage Diff @@
## master #2407 +/- ##
==================================================
+ Coverage 66.4099% 66.4248% +0.0149%
- Complexity 29892 29906 +14
==================================================
Files 1392 1393 +1
Lines 116823 116869 +46
Branches 20675 20682 +7
==================================================
+ Hits 77582 77630 +48
+ Misses 32874 32871 -3
- Partials 6367 6368 +1
```
| [Files with missing
lines](https://app.codecov.io/gh/apache/groovy/pull/2407?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
| Coverage Δ | |
|---|---|---|
|
[...va/groovy/lang/annotation/ExtendedElementType.java](https://app.codecov.io/gh/apache/groovy/pull/2407?src=pr&el=tree&filepath=src%2Fmain%2Fjava%2Fgroovy%2Flang%2Fannotation%2FExtendedElementType.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3JjL21haW4vamF2YS9ncm9vdnkvbGFuZy9hbm5vdGF0aW9uL0V4dGVuZGVkRWxlbWVudFR5cGUuamF2YQ==)
| `100.0000% <100.0000%> (ø)` | |
|
[...n/java/org/codehaus/groovy/ast/AnnotationNode.java](https://app.codecov.io/gh/apache/groovy/pull/2407?src=pr&el=tree&filepath=src%2Fmain%2Fjava%2Forg%2Fcodehaus%2Fgroovy%2Fast%2FAnnotationNode.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3JjL21haW4vamF2YS9vcmcvY29kZWhhdXMvZ3Jvb3Z5L2FzdC9Bbm5vdGF0aW9uTm9kZS5qYXZh)
| `72.5806% <90.0000%> (+3.3499%)` | :arrow_up: |
|
[...org/codehaus/groovy/classgen/ExtendedVerifier.java](https://app.codecov.io/gh/apache/groovy/pull/2407?src=pr&el=tree&filepath=src%2Fmain%2Fjava%2Forg%2Fcodehaus%2Fgroovy%2Fclassgen%2FExtendedVerifier.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3JjL21haW4vamF2YS9vcmcvY29kZWhhdXMvZ3Jvb3Z5L2NsYXNzZ2VuL0V4dGVuZGVkVmVyaWZpZXIuamF2YQ==)
| `93.8462% <82.6087%> (-1.0906%)` | :arrow_down: |
... and [4 files with indirect coverage
changes](https://app.codecov.io/gh/apache/groovy/pull/2407/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
</details>
<details><summary> :rocket: New features to boost your workflow: </summary>
- :snowflake: [Test
Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests,
report on failures, and find test suite problems.
- :package: [JS Bundle
Analysis](https://docs.codecov.com/docs/javascript-bundle-analysis): Save
yourself from yourself by tracking and limiting bundle sizes in JS merges.
</details>
> Close gaps in Groovy annotation validation
> ------------------------------------------
>
> Key: GROOVY-11884
> URL: https://issues.apache.org/jira/browse/GROOVY-11884
> Project: Groovy
> Issue Type: Improvement
> Reporter: Paul King
> Priority: Major
> Labels: breaking
>
> Groovy lets you have annotations like @Grab on various nodes and various
> statements including imports. Targeting imports is not possible in Java, but
> this is part of Groovy's stance of providing more flexibility.
> Groovy also does validation that annotations don't appear in incorrect
> places. Currently there is a gap in our validation - we ignore things like
> checking what things can be on imports, e.g. the following is currently valid
> but totally ignored:
> {code}
> @Deprecated
> import java.lang.String
> {code}
> As well as @Grab, @Newify and @BaseScript can also appear on imports.
> With the new incubating AST transforms on loops, @Invariant can now appear on
> loops.
> I propose we create some additional classes to capture these extended
> annotation targets and close the gaps in validation. Something like:
> {code}
> @Retention(RetentionPolicy.RUNTIME)
> @Target(ElementType.ANNOTATION_TYPE)
> public @interface ExtendedTarget {
> ExtendedElementType[] value();
> }
> {code}
> And:
> {code}
> public enum ExtendedElementType {
> /** Import statement. */
> IMPORT,
> /** Loop statement ({@code for}, {@code while}, {@code do-while}). */
> LOOP
> }
> {code}
> And then things like @BaseScript would change from this:
> {code}
> @Retention(RetentionPolicy.SOURCE)
> @Target({ElementType.LOCAL_VARIABLE, ElementType.PACKAGE, ElementType.TYPE
> /*, ElementType.IMPORT*/})
> @GroovyASTTransformationClass("org.codehaus.groovy.transform.BaseScriptASTTransformation")
> public @interface BaseScript {
> Class value() default Script.class;
> }
> {code}
> to this:
> {code}
> @Retention(RetentionPolicy.SOURCE)
> @Target({ElementType.LOCAL_VARIABLE, ElementType.PACKAGE, ElementType.TYPE})
> @ExtendedTarget(ExtendedElementType.IMPORT)
> @GroovyASTTransformationClass("org.codehaus.groovy.transform.BaseScriptASTTransformation")
> public @interface BaseScript {
> Class value() default Script.class;
> }
> {code}
> This would be a breaking change if any codebases are relying on Groovy's
> leniency, e.g. maybe they had a convention of putting @Deprecated on an
> import if they were hoping to eventually get rid of the related dependency.
> We don't know anyone doing this, but in such cases, folks would need to now
> make and use an annotation with @ExtendedTarget.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)