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

Align Patcher DSL implementation with Transformers #355

Merged
merged 6 commits into from
Sep 13, 2023

Conversation

MateuszKubuszok
Copy link
Member

@MateuszKubuszok MateuszKubuszok commented Sep 5, 2023

Any attempt to align Patchers with Transformers would inevitably break backward in classes definitions:

  • separating flags from configs would require renaming classes (what currently is called PatcherCfg is in fact counterpart to TransformerFlags without disabling)
  • providing flags through implicits would require additional (implicit) argument in .patch
  • adding overrides would require adding new methods and type parameters

Since branch 0.8.0 is not yet stabilized we are at luxury of breaking this - users who only update "stable" versions (with the early semver understanding of the word) would face only one such breaking change as opposed to several in the coming months if we would plan ahead these breaking changes and release them only once before some final API cleanup.

TODO:

  • update DSL:
    • split PatcherCfg from PatcherFlags
    • after Cfg <: PatcherCfg add Flags <: PatcherFlags
    • rename FlagsDsl to TransformerFlagsDsl, extract PatcherFlagsDsl
    • create PatcherConfiguration
    • add new implicit PatcherConfiguration[ImplicitScopeFlags <: PatcherFlags]
  • update macros:
    • parse new versions of PatcherCfg and PatcherFlags into config
    • start using ImplicitScopeFlags <: PatcherFlags
  • add missing functionality
    • create Patcher.AutoDerived to align with Transformers
    • introduce Patcher.derive and Patcher.define
  • update tests:
    • test that implicit cfg enables flags and that this can be overriden in instance flags

@MateuszKubuszok MateuszKubuszok linked an issue Sep 5, 2023 that may be closed by this pull request
…just DSL and macros to make it compile without using ImplicitScopeFlags yet
@codecov
Copy link

codecov bot commented Sep 11, 2023

Codecov Report

Patch coverage: 76.78% and project coverage change: +0.28% 🎉

Comparison is base (488f453) 79.02% compared to head (f956643) 79.31%.

❗ Current head f956643 differs from pull request most recent head 3b40689. Consider uploading reports for the commit 3b40689 to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #355      +/-   ##
==========================================
+ Coverage   79.02%   79.31%   +0.28%     
==========================================
  Files         105      107       +2     
  Lines        4020     4060      +40     
  Branches      191      139      -52     
==========================================
+ Hits         3177     3220      +43     
+ Misses        843      840       -3     
Files Changed Coverage Δ
...and/chimney/dsl/PartialTransformerDefinition.scala 66.66% <ø> (ø)
...scalaland/chimney/dsl/PartialTransformerInto.scala 66.66% <ø> (ø)
.../scalaland/chimney/dsl/TransformerDefinition.scala 83.33% <ø> (ø)
...a-2/io/scalaland/chimney/dsl/TransformerInto.scala 83.33% <ø> (ø)
...and/chimney/dsl/PartialTransformerDefinition.scala 50.00% <ø> (ø)
...scalaland/chimney/dsl/PartialTransformerInto.scala 50.00% <ø> (ø)
.../scalaland/chimney/dsl/TransformerDefinition.scala 75.00% <ø> (ø)
...a-3/io/scalaland/chimney/dsl/TransformerInto.scala 75.00% <ø> (ø)
...rnal/compiletime/dsl/PatcherDefinitionMacros.scala 0.00% <0.00%> (ø)
.../src/main/scala/io/scalaland/chimney/Patcher.scala 0.00% <0.00%> (ø)
... and 16 more

... and 9 files with indirect coverage changes

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

@MateuszKubuszok MateuszKubuszok force-pushed the patcher-implicit-config branch 2 times, most recently from 0a23ff0 to 7ed0ab6 Compare September 12, 2023 10:13
@MateuszKubuszok MateuszKubuszok merged commit 1071e3e into master Sep 13, 2023
@MateuszKubuszok MateuszKubuszok deleted the patcher-implicit-config branch September 13, 2023 14:04
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.

Implicitly scoped patcher configurations
1 participant