-
Notifications
You must be signed in to change notification settings - Fork 182
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
Not-Null Arrays when using --nullableReferenceAttributes
#338
Conversation
Codecov Report
@@ Coverage Diff @@
## master #338 +/- ##
==========================================
+ Coverage 95.53% 95.59% +0.05%
==========================================
Files 19 20 +1
Lines 3044 2880 -164
Branches 465 445 -20
==========================================
- Hits 2908 2753 -155
+ Misses 78 71 -7
+ Partials 58 56 -2
Continue to review full report at Codecov.
|
XmlSchemaClassGenerator/TypeModel.cs
Outdated
var privateSetter = isPrivateSetter ? "private " : string.Empty; | ||
member.Name += $" {{ get; {privateSetter}set; }}"; // hack to generate automatic property | ||
} | ||
member.Name += backingField != null |
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.
Can you revert this? Sonarcloud complains about the nested ternary operator and I think they have a point.
|
…idied up ModelBuilder (encapsulated common groups of property setters on PropertyModel, using IXmlSchemaNode).
No idea why a test failed (they pass locally), and can't figure out how to retry... |
Thanks for your hard work. Would love to merge this. Could you remove the remaining nested ternaries? |
You can click on the ❌ then Details to view the output from AppVeyor. Manual retry doesn't seem to possible unless you're the owner. |
(This is my personal account) I'm unable to make changes to the PR for 2 weeks. If there are particular ternary statements you want to revert, then go ahead, but personally I think if they're properly chained and formatted, then they're pretty clear and shouldn't be a problem. E.g.
|
When applying the latest release to our project, all of the NRT warnings were fixed except one. The difference for this is one was that the complex type was referenced rather than inline, and just changing that has removed the nullable attributes, however since it is also never null in the initial state, I thought this change should be made. There's no rush to complete this, and I think it may need some more thought.
Combine
IsCollection
,IsArray
andIsList
intoIsEnumerable
, and use for nullable attribute prevention.Moved
GetSet
intoGetAccessors
to avoid nested ternaryTidied up
ModelBuilder
by encapsulating common groups of property setters onPropertyModel
, usingIXmlSchemaNode
.