Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds support for Sprout-generated equality/hashCode #1182

Merged
merged 2 commits into from
Aug 22, 2023
Merged

Conversation

johnedquinn
Copy link
Member

@johnedquinn johnedquinn commented Aug 21, 2023

Relevant Issues

Description

  • Converts generation of Sprout product types to be abstract classes
  • Adds default equality and hashCode methods to each product
  • Previous generation resulted in interfaces
  • Added a :test/sprout-tests subproject to run integration tests on generated code

Other Information

  • Updated Unreleased Section in CHANGELOG: YES
  • Any backward-incompatible changes? YES
    • Yes, see CHANGELOG
  • Any new external dependencies? NO
  • Do your changes comply with the Contributing Guidelines
    and Code Style Guidelines? NO

License Information

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Adds default  and  methods to each product

Previous generation resulted in interfaces
@github-actions
Copy link

github-actions bot commented Aug 21, 2023

Conformance comparison report

Base (eb0b72e) acccd01 +/-
% Passing 92.33% 92.33% 0.00%
✅ Passing 5372 5372 0
❌ Failing 446 446 0
🔶 Ignored 0 0 0
Total Tests 5818 5818 0

Number passing in both: 5372

Number failing in both: 446

Number passing in Base (eb0b72e) but now fail: 0

Number failing in Base (eb0b72e) but now pass: 0

@johnedquinn johnedquinn marked this pull request as ready for review August 21, 2023 17:47
Comment on lines +199 to +201
this.props.forEach { prop ->
body.addStatement("if (%N != other.%N) return false", prop.name, prop.name)
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should deeply compare collections as well

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be deeply comparing as-is. I just pushed tests to show some examples. Thanks!

@codecov-commenter
Copy link

Codecov Report

Patch and project coverage have no change.

Comparison is base (eb0b72e) 71.55% compared to head (702aaca) 71.55%.

Additional details and impacted files
@@            Coverage Diff            @@
##               main    #1182   +/-   ##
=========================================
  Coverage     71.55%   71.55%           
  Complexity     2323     2323           
=========================================
  Files           224      224           
  Lines         17097    17097           
  Branches       3189     3189           
=========================================
  Hits          12233    12233           
  Misses         3881     3881           
  Partials        983      983           
Flag Coverage Δ
CLI 13.53% <ø> (ø)
EXAMPLES 80.28% <ø> (ø)
LANG 79.11% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@johnedquinn johnedquinn merged commit 674e140 into main Aug 22, 2023
10 checks passed
@johnedquinn johnedquinn deleted the sprout-equals branch August 22, 2023 17:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants