[ 
https://issues.apache.org/jira/browse/GROOVY-12013?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18081350#comment-18081350
 ] 

ASF GitHub Bot commented on GROOVY-12013:
-----------------------------------------

codecov-commenter commented on PR #2536:
URL: https://github.com/apache/groovy/pull/2536#issuecomment-4465886670

   ## 
[Codecov](https://app.codecov.io/gh/apache/groovy/pull/2536?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 `67.88991%` with `35 lines` in your changes missing 
coverage. Please review.
   :white_check_mark: Project coverage is 68.1266%. Comparing base 
([`2f2ac9d`](https://app.codecov.io/gh/apache/groovy/commit/2f2ac9d2ea4bc7c8c6998c35dc733a346ebe8c64?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache))
 to head 
([`79bfb2a`](https://app.codecov.io/gh/apache/groovy/commit/79bfb2a6fa0b881e6ceffd61c07829fbf686bc01?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
   :warning: Report is 8 commits behind head on master.
   
   | [Files with missing 
lines](https://app.codecov.io/gh/apache/groovy/pull/2536?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
 | Patch % | Lines |
   |---|---|---|
   | 
[.../groovy/groovy/typecheckers/CombinerChecker.groovy](https://app.codecov.io/gh/apache/groovy/pull/2536?src=pr&el=tree&filepath=subprojects%2Fgroovy-typecheckers%2Fsrc%2Fmain%2Fgroovy%2Fgroovy%2Ftypecheckers%2FCombinerChecker.groovy&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3VicHJvamVjdHMvZ3Jvb3Z5LXR5cGVjaGVja2Vycy9zcmMvbWFpbi9ncm9vdnkvZ3Jvb3Z5L3R5cGVjaGVja2Vycy9Db21iaW5lckNoZWNrZXIuZ3Jvb3Z5)
 | 67.8899% | [2 Missing and 33 partials :warning: 
](https://app.codecov.io/gh/apache/groovy/pull/2536?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>
   
   
   
   [![Impacted file tree 
graph](https://app.codecov.io/gh/apache/groovy/pull/2536/graphs/tree.svg?width=650&height=150&src=pr&token=1r45138NfQ&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)](https://app.codecov.io/gh/apache/groovy/pull/2536?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
   
   ```diff
   @@                Coverage Diff                 @@
   ##               master      #2536        +/-   ##
   ==================================================
   - Coverage     68.1383%   68.1266%   -0.0117%     
   - Complexity      32755      32791        +36     
   ==================================================
     Files            1499       1500         +1     
     Lines          125238     125349       +111     
     Branches        22604      22654        +50     
   ==================================================
   + Hits            85335      85396        +61     
   - Misses          32387      32408        +21     
   - Partials         7516       7545        +29     
   ```
   
   | [Files with missing 
lines](https://app.codecov.io/gh/apache/groovy/pull/2536?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
 | Coverage Δ | |
   |---|---|---|
   | 
[.../groovy/groovy/typecheckers/CombinerChecker.groovy](https://app.codecov.io/gh/apache/groovy/pull/2536?src=pr&el=tree&filepath=subprojects%2Fgroovy-typecheckers%2Fsrc%2Fmain%2Fgroovy%2Fgroovy%2Ftypecheckers%2FCombinerChecker.groovy&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3VicHJvamVjdHMvZ3Jvb3Z5LXR5cGVjaGVja2Vycy9zcmMvbWFpbi9ncm9vdnkvZ3Jvb3Z5L3R5cGVjaGVja2Vycy9Db21iaW5lckNoZWNrZXIuZ3Jvb3Z5)
 | `67.8899% <67.8899%> (ø)` | |
   
   ... and [124 files with indirect coverage 
changes](https://app.codecov.io/gh/apache/groovy/pull/2536/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>




> New optional type checking extension: CombinerChecker to verify associative 
> combiners in injectParallel/sumParallel/Stream.reduce
> ---------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: GROOVY-12013
>                 URL: https://issues.apache.org/jira/browse/GROOVY-12013
>             Project: Groovy
>          Issue Type: New Feature
>            Reporter: Paul King
>            Assignee: Paul King
>            Priority: Major
>
> h3. Summary
> Adds two incubating annotations and an opt-in type-checking extension that
> verify, at compile time, that the combining function passed to an
> order-independent reduction is associative — the contract such reductions
> silently require but cannot otherwise enforce.
> h3. Annotations ({{groovy.transform}})
> * {{@Associative}} — declares a two-argument combiner is associative:
>   {{combine(a, combine(b, c)) == combine(combine(a, b), c)}}.
> * {{@Reducer}} — associative *and* has an identity element, named via the
>   {{zero()}} member (e.g. {{@Reducer(zero = '0')}}).
> h3. CombinerChecker ({{groovy.typecheckers}})
> A type-checking extension enabled with
> {{@TypeChecked(extensions='groovy.typecheckers.CombinerChecker')}}.
> It inspects the combiner of:
> * Groovy's parallel collection reductions {{injectParallel}} and
>   {{sumParallel}};
> * the JDK stream reductions {{Stream}}, {{IntStream}}, {{LongStream}} and
>   {{DoubleStream}} {{reduce}} (all overloads).
> The combiner is accepted when it is:
> * a method reference to an {{@Associative}}/{{@Reducer}} method; or
> * a method reference to, or a thin delegating closure over, a {{Monoid}}
>   or {{Semigroup}} from any library (matched by simple type name —
>   Functional Java, Palatable Lambda, Purefun, etc. — configurable via the
>   {{monoids}}/{{semigroups}} options, no dependency added).
> It reports a compile-time error when:
> * an inline closure applies a non-associative operator ({{-}}, {{/}}, {{%}},
>   {{**}}) directly to its two arguments;
> * the seed of a seeded reduction contradicts a {{@Reducer}}'s declared
>   identity;
> * a {{Semigroup}} (which has no identity) is used with a seeded reduction
>   that requires one.
> Two modes: the default (lenient) flags only high-confidence problems; *strict*
> ({{CombinerChecker(mode: 'strict')}}) additionally requires the combiner to
> carry a declared, verifiable contract.
> h3. Notes and non-goals
> * The checker runs only under {{@TypeChecked}}/{{@CompileStatic}} and treats
>   the annotations/carrier types as asserted contracts (not proofs);
>   sequential {{inject}} is deliberately never flagged.
> * The inline-closure check is syntactic and assumes operators carry their
>   conventional meaning. Resolving overloaded operators is a non-goal: in
>   particular, overloading a normally-associative operator (e.g. {{+}}, {{*}})
>   to be non-associative is poor style and is not detected by design. The
>   declaration paths ({{@Associative}}/{{@Reducer}}, Monoid/Semigroup) are the
>   reliable, overloading-immune way to assert the contract.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to