[ https://issues.apache.org/jira/browse/GROOVY-10683?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17939510#comment-17939510 ]
ASF GitHub Bot commented on GROOVY-10683: ----------------------------------------- codecov-commenter commented on PR #2169: URL: https://github.com/apache/groovy/pull/2169#issuecomment-2764765742 ## [Codecov](https://app.codecov.io/gh/apache/groovy/pull/2169?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report Attention: Patch coverage is `96.42857%` with `1 line` in your changes missing coverage. Please review. > Project coverage is 68.8455%. Comparing base [(`6ce967f`)](https://app.codecov.io/gh/apache/groovy/commit/6ce967f8019f175e589e71873f025b0a16bb0a13?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) to head [(`d92cb47`)](https://app.codecov.io/gh/apache/groovy/commit/d92cb475a461dd55f1d8c355d9513edb1f15cc41?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/2169?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Patch % | Lines | |---|---|---| | [...va/org/apache/groovy/parser/antlr4/AstBuilder.java](https://app.codecov.io/gh/apache/groovy/pull/2169?src=pr&el=tree&filepath=src%2Fmain%2Fjava%2Forg%2Fapache%2Fgroovy%2Fparser%2Fantlr4%2FAstBuilder.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2dyb292eS9wYXJzZXIvYW50bHI0L0FzdEJ1aWxkZXIuamF2YQ==) | 94.1176% | [0 Missing and 1 partial :warning: ](https://app.codecov.io/gh/apache/groovy/pull/2169?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/2169?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) ```diff @@ Coverage Diff @@ ## master #2169 +/- ## ================================================== + Coverage 68.8443% 68.8455% +0.0011% - Complexity 29533 29535 +2 ================================================== Files 1421 1421 Lines 113424 113425 +1 Branches 19644 19644 ================================================== + Hits 78086 78088 +2 - Misses 28754 28756 +2 + Partials 6584 6581 -3 ``` | [Files with missing lines](https://app.codecov.io/gh/apache/groovy/pull/2169?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | | |---|---|---| | [...ava/org/codehaus/groovy/ast/stmt/ForStatement.java](https://app.codecov.io/gh/apache/groovy/pull/2169?src=pr&el=tree&filepath=src%2Fmain%2Fjava%2Forg%2Fcodehaus%2Fgroovy%2Fast%2Fstmt%2FForStatement.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3JjL21haW4vamF2YS9vcmcvY29kZWhhdXMvZ3Jvb3Z5L2FzdC9zdG10L0ZvclN0YXRlbWVudC5qYXZh) | `100.0000% <100.0000%> (ø)` | | | [...va/org/apache/groovy/parser/antlr4/AstBuilder.java](https://app.codecov.io/gh/apache/groovy/pull/2169?src=pr&el=tree&filepath=src%2Fmain%2Fjava%2Forg%2Fapache%2Fgroovy%2Fparser%2Fantlr4%2FAstBuilder.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2dyb292eS9wYXJzZXIvYW50bHI0L0FzdEJ1aWxkZXIuamF2YQ==) | `86.6310% <94.1176%> (+0.0060%)` | :arrow_up: | ... and [3 files with indirect coverage changes](https://app.codecov.io/gh/apache/groovy/pull/2169/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> > Consider enhancing for loop to provide access to loop index or iterator > ----------------------------------------------------------------------- > > Key: GROOVY-10683 > URL: https://issues.apache.org/jira/browse/GROOVY-10683 > Project: Groovy > Issue Type: New Feature > Components: parser-antlr4 > Reporter: Eric Milles > Priority: Minor > > When iterating over an array or iterable, there is choice between traditional > counting loop for index access, declaring/managing an external variable to > leverage for-each loop, or switching to {{eachWithIndex}} which requires > quite a bit more runtime investment. > {code:groovy} > for (int i = 0, n = array.length; i < n; i += 1) { > def val = array[i] > } > int idx = 0; for (val in array) { > idx += 1; > } > // idiomatic and takes care of all the management, but lacks STC support for > primitive arrays and adds the cost of method invocation for each iteration > array.eachWithIndex { val, idx -> > } > {code} > Please consider the possibility of {{for}} loop enhancements of > [Gosu|https://gosu-lang.github.io/docs.html], which provides a direct syntax > for index or iterator: > {code} > for (val in array index idx) { > println "$idx: $val" > } > for (value in iterable iterator iter) { // could be ListIterator for List > types, which increases options > iter.remove() // for example > } > {code} -- This message was sent by Atlassian Jira (v8.20.10#820010)