[ https://issues.apache.org/jira/browse/GROOVY-10683?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17939453#comment-17939453 ]
ASF GitHub Bot commented on GROOVY-10683: ----------------------------------------- codecov-commenter commented on PR #2169: URL: https://github.com/apache/groovy/pull/2169#issuecomment-2764337307 ## [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 `92.30769%` with `3 lines` in your changes missing coverage. Please review. > Project coverage is 68.8444%. Comparing base [(`d50a84f`)](https://app.codecov.io/gh/apache/groovy/commit/d50a84f3df92559850834abac9504c8265eaa1d4?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) to head [(`e7ec9a8`)](https://app.codecov.io/gh/apache/groovy/commit/e7ec9a88eadcbdbb9393d22ab0ebea454fb2306c?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache). > Report is 2 commits behind head on master. | [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==) | 89.2857% | [1 Missing and 2 partials :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.8526% 68.8444% -0.0082% + Complexity 29536 29535 -1 ================================================== Files 1421 1421 Lines 113406 113418 +12 Branches 19640 19642 +2 ================================================== - Hits 78083 78082 -1 - Misses 28748 28758 +10 - Partials 6575 6578 +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.6075% <89.2857%> (-0.0175%)` | :arrow_down: | ... 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)