Skip to content

feat: add option to ignore enum values#536

Merged
latonz merged 1 commit into
riok:mainfrom
latonz:337-ignored-enum-values
Jul 14, 2023
Merged

feat: add option to ignore enum values#536
latonz merged 1 commit into
riok:mainfrom
latonz:337-ignored-enum-values

Conversation

@latonz

@latonz latonz commented Jul 4, 2023

Copy link
Copy Markdown
Contributor

Adds option to ignore enum values

Adds new attributes MapperIgnoreSourceValue and MapperIgnoreTargetValue to ignore source/target enum values. This is especially useful for strict enum mappings (to ignore single values not present in the source and/or target without emitting a diagnostic).

Fixes #337

Checklist

  • The existing code style is followed
  • The commit message follows our guidelines
  • Performed a self-review of my code
  • Hard-to-understand areas of my code are commented
  • The documentation is updated (as applicable)
  • Unit tests are added/updated
  • Integration tests are added/updated (as applicable, especially if feature/bug depends on roslyn or framework version in use)

@latonz latonz self-assigned this Jul 4, 2023
@codecov

codecov Bot commented Jul 4, 2023

Copy link
Copy Markdown

Codecov Report

Merging #536 (3a2a29d) into main (85347e4) will decrease coverage by 0.98%.
The diff coverage is 89.07%.

@@            Coverage Diff             @@
##             main     #536      +/-   ##
==========================================
- Coverage   91.96%   90.99%   -0.98%     
==========================================
  Files         147      166      +19     
  Lines        4656     5606     +950     
  Branches      588      710     +122     
==========================================
+ Hits         4282     5101     +819     
- Misses        254      354     +100     
- Partials      120      151      +31     
Impacted Files Coverage Δ
...y.Abstractions/MapperIgnoreSourceValueAttribute.cs 0.00% <0.00%> (ø)
...y.Abstractions/MapperIgnoreTargetValueAttribute.cs 0.00% <0.00%> (ø)
src/Riok.Mapperly/Helpers/HashHelper.cs 0.00% <0.00%> (ø)
...numerables/EnsureCapacity/EnsureCapacityBuilder.cs 45.94% <42.10%> (-32.32%) ⬇️
src/Riok.Mapperly/MapperResults.cs 50.00% <50.00%> (ø)
src/Riok.Mapperly/ImmutableEquatableArray.cs 54.54% <54.54%> (ø)
...ok.Mapperly/Configuration/AttributeDataAccessor.cs 68.88% <64.58%> (-7.93%) ⬇️
.../Descriptors/MappingBuilders/SpanMappingBuilder.cs 80.00% <80.00%> (ø)
.../Descriptors/MappingBuilders/EnumMappingBuilder.cs 84.75% <81.13%> (-7.01%) ⬇️
...lders/NewInstanceObjectMemberMappingBodyBuilder.cs 80.00% <83.33%> (+1.21%) ⬆️
... and 63 more

... and 2 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@latonz
latonz marked this pull request as ready for review July 13, 2023 13:38
@latonz
latonz requested a review from CommonGuy July 13, 2023 13:38
@latonz
latonz merged commit 3e2a2c8 into riok:main Jul 14, 2023
@latonz
latonz deleted the 337-ignored-enum-values branch July 14, 2023 11:01
@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 2.9.0-next.3 🎉

The release is available on:

Your semantic-release bot 📦🚀

@github-actions

github-actions Bot commented Aug 7, 2023

Copy link
Copy Markdown

🎉 This PR is included in version 3.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

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.

Ignore enum values

2 participants