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

Ignoring redundant patcher fields #130

Merged
merged 13 commits into from
Jan 21, 2020
Merged

Conversation

krzemin
Copy link
Member

@krzemin krzemin commented Jan 18, 2020

This PR introduces support for patches with redundant fields:

case class Foo(a: A, b: B)
case class Patch(b: B, c: C)

// so far it led to compile error: no accessor named c in source type Foo
Foo(...).patchUsing(Bar(...)) 

// now we have an option to ignore redundant fields in patch
Foo(...).using(Bar(...)).ignoreRedundantPatcherFields.patch
// it patches only value of b: B of Foo

It addresses #106 and partially #98

@codecov
Copy link

codecov bot commented Jan 18, 2020

Codecov Report

Merging #130 into master will decrease coverage by 0.25%.
The diff coverage is 97.22%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #130      +/-   ##
==========================================
- Coverage   96.21%   95.95%   -0.26%     
==========================================
  Files          11       13       +2     
  Lines         475      495      +20     
  Branches       58       68      +10     
==========================================
+ Hits          457      475      +18     
- Misses         18       20       +2
Impacted Files Coverage Δ
...nd/chimney/internal/macros/TransformerMacros.scala 95.4% <ø> (ø) ⬆️
...alaland/chimney/internal/dsl/TransformerInto.scala 100% <ø> (ø) ⬆️
...d/chimney/internal/dsl/TransformerDefinition.scala 100% <ø> (ø) ⬆️
...o/scalaland/chimney/internal/dsl/PatcherInto.scala 100% <100%> (ø)
...ala/io/scalaland/chimney/internal/PatcherCfg.scala 100% <100%> (ø)
...io/scalaland/chimney/internal/TransformerCfg.scala 100% <100%> (ø)
.../main/scala/io/scalaland/chimney/Transformer.scala 100% <100%> (ø) ⬆️
...mney/src/main/scala/io/scalaland/chimney/dsl.scala 80% <66.66%> (-20%) ⬇️
...laland/chimney/internal/macros/PatcherMacros.scala 90% <90%> (ø)
... and 3 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 17b227b...da959de. Read the comment docs.

@krzemin krzemin changed the title Incomplete patches Ignoring redundant patcher fields Jan 18, 2020
@krzemin krzemin changed the base branch from master to feature/transformer-definition-dsl January 18, 2020 19:26
@krzemin krzemin changed the base branch from feature/transformer-definition-dsl to master January 21, 2020 14:45
@krzemin krzemin merged commit 85c2d6f into master Jan 21, 2020
@krzemin krzemin deleted the feature/incomplete-patches branch January 23, 2020 12: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.

2 participants