-
-
Notifications
You must be signed in to change notification settings - Fork 201
feat: Added support for IFormatProvider in parse method #2038
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
base: main
Are you sure you want to change the base?
Conversation
latonz
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for this contribution, looks pretty good already!
src/Riok.Mapperly/Descriptors/MappingBuilders/ParseMappingBuilder.cs
Outdated
Show resolved
Hide resolved
src/Riok.Mapperly/Descriptors/MappingBuilders/ParseMappingBuilder.cs
Outdated
Show resolved
Hide resolved
src/Riok.Mapperly/Descriptors/MappingBuilders/ParseMappingBuilder.cs
Outdated
Show resolved
Hide resolved
ecee33d to
eaa71cc
Compare
latonz
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One nitpick left, also the tests need to be fixed.
31007ad to
d6c5c47
Compare
|
I am wondering if technicallyyyy this could be considered a breaking change? Only in the situation if someone had a default FormatProvider defined for use in ToString, and was relying on the fact that Parse was not using that FormatProvider, this update would change that behaviour |
|
@Nysosis yes, that's definitely a breaking change. |
|
You are absolutely right, this is definitely a breaking change. We plan to release the next breaking change with all open breaking change PR's (and maybe some other breaking changes) at the beginning of next year. |
|
With regards to those breaking integration tests for framework and net8 @latonz, is this a case of 'You may need to manually update older versions' ? As when I'm running the integration tests via VS or |
You'd need to run these tests with .NET 8.0/.NET Framework... However, usually it is easier to download the artifacts from the GitHub Actions Artifacts (you can find these here), extract and merge into your source, review the received/verified files and approve & commit them if ok. |
|
Should the the tests for net6 and net7 be running on the GH pipelines? As it's not finding any:
Noticed because I would have expected the snapshot verifications for 6&7 to also change (because they also support the formatprovider on int/guid parse) - if I change the sample project locally to be net 6.0 and add a format provider than the generated carmapper uses it. |
Oh wow, I’m curious how long these haven’t been running. I’ll look into it. Since .NET 6 and 7 are no longer supported by Microsoft, we’re planning to drop support for them in Mapperly with the next breaking release. Because this will also be a breaking change, there’s nothing you need to worry about right now. Thanks for letting me know! |
I think it's the version of xunit.runner.visualstudio doing it, I dropped it down to 2.8.2 and was eventually able to get it running the net6 tests when using some dotnet command line arguments magic, but good to know I don't need to worry about them. Will push up the framework/net8 snapshot changes :) |
Extended ParseMappingBuilder to act more like the ToStringMappingBuilder to resolve the method Created and returned new ParseMethodMapping to handle the potential IFormatProvider argument
d6c5c47 to
c7981b6
Compare
Adding support for IFormatProvider into static Parse method detetction
Description
Extended ParseMappingBuilder to act more like the ToStringMappingBuilder to resolve the method
Created and returned new ParseMethodMapping to handle the potential IFormatProvider argument
Fixes #1875
Checklist