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
feat: support init properties #52
Conversation
3ac267f
to
2afc80b
Compare
Codecov Report
@@ Coverage Diff @@
## main #52 +/- ##
==========================================
- Coverage 89.83% 89.33% -0.51%
==========================================
Files 66 72 +6
Lines 1968 2325 +357
Branches 261 299 +38
==========================================
+ Hits 1768 2077 +309
- Misses 138 182 +44
- Partials 62 66 +4
📣 Codecov can now indicate which changes are the most critical in Pull Requests. Learn more |
public static readonly DiagnosticDescriptor CanNotMapToInitOnlyPropertyPath = new( | ||
"RMG015", | ||
"Can not map to init only property path", | ||
"Can not map from property {0}.{1} of type {2} to init only property path {3}.{4} of type {5}", |
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.
The correct spelling is "Cannot" as a whole word. Applies to all occurences in this class. Also change the variable name
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.
Fixed.
@@ -183,7 +184,8 @@ private Riok.Mapperly.IntegrationTests.Models.InheritanceSubObject MapToInherita | |||
|
|||
private partial Riok.Mapperly.IntegrationTests.Dto.TestObjectDto MapToDtoInternal(Riok.Mapperly.IntegrationTests.Models.TestObject testObject) | |||
{ | |||
var target = new Riok.Mapperly.IntegrationTests.Dto.TestObjectDto(DirectInt(testObject.CtorValue), ctorValue2: DirectInt(testObject.CtorValue2)); | |||
var target = new Riok.Mapperly.IntegrationTests.Dto.TestObjectDto(DirectInt(testObject.CtorValue), ctorValue2: DirectInt(testObject.CtorValue2)) | |||
{IntInitOnlyValue = DirectInt(testObject.IntInitOnlyValue), }; |
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.
Do we have any control over the formatting? Looks kinda strange to me
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.
Currently we use the high level roslyn syntax apis with NormalizeWhitespace()
which results in this formatting. However, I removed the trailing comma which improves it a little. If we wanted to control this, we would ned to remove the normalize whitespace call and add whitespaces manually everywhere which wouldn't be effective IMO.
bb3e6a3
to
bd0b914
Compare
bd0b914
to
8b61c73
Compare
🎉 This PR is included in version 2.2.0-next.2 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
🎉 This PR is included in version 2.2.0 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
No description provided.