Skip to content

feat: Added MapEnumValueAttribute and support for explicit enum value mapping#468

Merged
latonz merged 23 commits into
riok:mainfrom
peteraritchie:main
Jun 6, 2023
Merged

feat: Added MapEnumValueAttribute and support for explicit enum value mapping#468
latonz merged 23 commits into
riok:mainfrom
peteraritchie:main

Conversation

@peteraritchie

@peteraritchie peteraritchie commented May 29, 2023

Copy link
Copy Markdown
Contributor

Added MapEnumValueAttribute and support for explicit enum value mapping

Description

Fixes #336

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)

@peteraritchie peteraritchie changed the title Added MapEnumValueAttribute and support for explicit enum value mapping feat: Added MapEnumValueAttribute and support for explicit enum value mapping May 30, 2023

@latonz latonz left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thank you for this great contribution! 🚀 I appreciate your effort in working on this issue.

I added my review comments. Feel free to challenge any feedback provided.
FYI: Until your first contribution to this organization is merged, I need to manually approve pipeline runs...

Once you've made the necessary adjustments, feel free to ping me for another review. Keep up the good work!

Comment thread docs/docs/02-configuration/04-enum.mdx Outdated
Comment thread src/Riok.Mapperly.Abstractions/MapEnumValueAttribute.cs Outdated
Comment thread src/Riok.Mapperly.Abstractions/PublicAPI.Unshipped.txt Outdated
Comment thread docs/docs/02-configuration/04-enum.mdx Outdated
Comment thread src/Riok.Mapperly/Descriptors/MappingBuilders/EnumMappingBuilder.cs Outdated
Comment thread src/Riok.Mapperly/Descriptors/MappingBuilders/EnumMappingBuilder.cs Outdated
Comment thread test/Riok.Mapperly.IntegrationTests/Mapper/TestMapper.cs Outdated
Comment thread test/Riok.Mapperly.Tests/Mapping/EnumTest.cs
Comment thread test/Riok.Mapperly.Tests/Mapping/EnumTest.cs
Comment thread test/Riok.Mapperly.Tests/Mapping/EnumTest.cs Outdated
peteraritchie and others added 13 commits May 30, 2023 12:13
Bumps [actions/setup-dotnet](https://github.com/actions/setup-dotnet) from 3.0.3 to 3.2.0.
- [Release notes](https://github.com/actions/setup-dotnet/releases)
- [Commits](actions/setup-dotnet@v3.0.3...v3.2.0)

---
updated-dependencies:
- dependency-name: actions/setup-dotnet
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [Verify.XUnit](https://github.com/VerifyTests/Verify) from 20.0.0 to 20.3.0.
- [Release notes](https://github.com/VerifyTests/Verify/releases)
- [Commits](VerifyTests/Verify@20.0.0...20.3.0)

---
updated-dependencies:
- dependency-name: Verify.XUnit
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

@latonz latonz left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thank you for the updates 😊
Sorry I only caught some review feedbacks on this second review...

Comment thread src/Riok.Mapperly/Diagnostics/DiagnosticDescriptors.cs
Comment thread src/Riok.Mapperly/Descriptors/MappingBuilders/EnumMappingBuilder.cs
Comment thread src/Riok.Mapperly/Descriptors/MappingBuilders/EnumMappingBuilder.cs
Comment thread test/Riok.Mapperly.IntegrationTests/Mapper/TestMapper.cs Outdated
Comment thread test/Riok.Mapperly.Tests/Mapping/EnumTest.cs Outdated
Comment thread src/Riok.Mapperly/AnalyzerReleases.Shipped.md Outdated
@codecov

codecov Bot commented Jun 1, 2023

Copy link
Copy Markdown

Codecov Report

Merging #468 (2e4fc79) into main (b17f666) will increase coverage by 0.33%.
The diff coverage is 94.17%.

@@            Coverage Diff             @@
##             main     #468      +/-   ##
==========================================
+ Coverage   92.08%   92.41%   +0.33%     
==========================================
  Files         135      141       +6     
  Lines        4282     4496     +214     
  Branches      591      574      -17     
==========================================
+ Hits         3943     4155     +212     
- Misses        225      227       +2     
  Partials      114      114              
Impacted Files Coverage Δ
...iok.Mapperly.Abstractions/MapEnumValueAttribute.cs 0.00% <0.00%> (ø)
...scriptors/InlineExpressionMappingBuilderContext.cs 95.12% <ø> (ø)
...appingBodyBuilders/UserMethodMappingBodyBuilder.cs 90.47% <ø> (ø)
...Riok.Mapperly/Descriptors/MappingBuilderContext.cs 98.14% <ø> (ø)
...erly/Descriptors/MappingBuilders/MappingBuilder.cs 100.00% <ø> (ø)
src/Riok.Mapperly/Descriptors/MappingCollection.cs 100.00% <ø> (ø)
...iok.Mapperly/Descriptors/Mappings/MethodMapping.cs 95.00% <ø> (ø)
...Mappings/UserDefinedExistingTargetMethodMapping.cs 87.17% <ø> (ø)
...serMappings/UserDefinedNewInstanceMethodMapping.cs 100.00% <ø> (ø)
...pings/UserMappings/UserImplementedMethodMapping.cs 90.90% <ø> (ø)
... and 33 more

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

latonz
latonz previously approved these changes Jun 1, 2023
@latonz

latonz commented Jun 2, 2023

Copy link
Copy Markdown
Contributor

@peteraritchie the integration test snapshots for older frameworks have some differences which need to be fixed before merging. You can download the received snapshots of the github action here: artifact verify-test-results.

@latonz

latonz commented Jun 6, 2023

Copy link
Copy Markdown
Contributor

@peteraritchie Thank you for the updates 😊 Could you rebase onto main? And then we are ready to merge 🎉

@latonz
latonz merged commit 64e6c9d into riok:main Jun 6, 2023
@tore-hammervoll

Copy link
Copy Markdown

Any chance of getting this out soon in a new prerelease 2.9.0-next.2?

I'm currently migrating from AutoMapper and have a need for this. I'd like to test this as soon as possible.

@latonz

latonz commented Jun 9, 2023

Copy link
Copy Markdown
Contributor

@tore-hammervoll-spv we plan to release 2.9.0-next.2 next week.

@github-actions

Copy link
Copy Markdown

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

The release is available on:

Your semantic-release bot 📦🚀

@latonz latonz added this to the v2.9.0 milestone Jun 14, 2023
@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.

Explicit enum value mapping

3 participants