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

Add ability to provie a custom constructor #439

Merged
merged 22 commits into from
Dec 18, 2023
Merged

Conversation

MateuszKubuszok
Copy link
Member

@MateuszKubuszok MateuszKubuszok commented Nov 21, 2023

TODO:

  • create the type-level representation for storing arguments' names and types
  • parse the type-level representation in TransformerCfg in macros
  • convert function's/method's type-level representation + expression which contains the lambda into Product.Constructor
  • wire custom constructor in ProductToProduct rule
  • create withConstructor and withConstructorPartial in DSL
    • parse withConstructor(objectWithApply) (allowing multiple parameter lists) in Scala 2
    • parse withConstructor { (arg: Arg, arg2: Arg2) => ... } in Scala 2
    • parse withConstructor(objectWithApply) (allowing multiple parameter lists) in Scala 3
    • parse withConstructor { (arg: Arg, arg2: Arg2) => ... } in Scala 3
    • same for withConstructorPartial
  • create TotalTransformerCustomConstructorSpec
  • create PartialTransformerCustomConstructorSpec
  • create MkDocs documentation
    • warning, mention 22-limit even on Scala 3
  • create Scaladoc documentation

@MateuszKubuszok MateuszKubuszok linked an issue Nov 21, 2023 that may be closed by this pull request
Copy link

codecov bot commented Nov 21, 2023

Codecov Report

Attention: 69 lines in your changes are missing coverage. Please review.

Comparison is base (a332903) 85.44% compared to head (f8524e9) 84.99%.

Files Patch % Lines
...ey/internal/compiletime/ChimneyTypesPlatform.scala 57.69% 11 Missing ⚠️
...ey/internal/compiletime/ChimneyTypesPlatform.scala 70.96% 9 Missing ⚠️
...internal/compiletime/dsl/utils/DslMacroUtils.scala 76.92% 9 Missing ⚠️
...letime/derivation/transformer/Configurations.scala 80.00% 9 Missing ⚠️
...etime/dsl/PartialTransformerDefinitionMacros.scala 66.66% 6 Missing ⚠️
...internal/compiletime/dsl/utils/DslMacroUtils.scala 89.13% 5 Missing ⚠️
...in/scala/io/scalaland/chimney/partial/Result.scala 0.00% 4 Missing ⚠️
...er/rules/TransformProductToProductRuleModule.scala 88.88% 3 Missing ⚠️
...compiletime/dsl/PartialTransformerIntoMacros.scala 66.66% 2 Missing ⚠️
...nd/chimney/internal/compiletime/ChimneyExprs.scala 33.33% 2 Missing ⚠️
... and 9 more
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #439      +/-   ##
==========================================
- Coverage   85.44%   84.99%   -0.45%     
==========================================
  Files         118      119       +1     
  Lines        4720     5186     +466     
  Branches      194      200       +6     
==========================================
+ Hits         4033     4408     +375     
- Misses        687      778      +91     

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

@MateuszKubuszok MateuszKubuszok marked this pull request as ready for review December 18, 2023 19:48
@MateuszKubuszok MateuszKubuszok merged commit fe2dd43 into master Dec 18, 2023
21 of 23 checks passed
@MateuszKubuszok MateuszKubuszok deleted the with-constructor branch December 18, 2023 20: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.

Transform through method other than default constructor
1 participant