-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Enable more code style rules #20694
Enable more code style rules #20694
Conversation
b859537
to
8a5a115
Compare
These mostly look like good cleanups, except IMO 16 and 37 which i'm not convinced are improvements. |
I'm concerned about IDE0016. As far as I understand those checks are there to throw early. Also do add punctuation to the descriptions |
Removals in IDE0016 is my fault. Given our thorough lack of argument null checks in the solution, having just three of them seemed arbitrary so I chose to remove them rather than change. However we could keep those if desired and change to throw expressions, or disable the rule. |
It might be worth going through git blame and investigatie each situation |
8a5a115
to
27677fc
Compare
Removed 16 and 37, added missing full stops. |
FWIW 37 is somehting we do elsewhere a bunch and IMO it does make sense as a rule. |
# Use coalesce expression (nullable types). | ||
dotnet_diagnostic.IDE0030.severity = warning | ||
|
||
# Use explicitly provided tuple 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.
# Use explicitly provided tuple name. | |
# Prefer explicitly provided tuple element 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.
I've been copy pasting the titles of the docs, e.g. https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0033. Don't feel like changing the approach much for one item.
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.
Weird. I commented because that's not the title VSCode gave me 🤷♂️ Alright then, never mind.
Thanks! 🎊 |
Enforces
2119 style rules across the project, and 2 complier warnings related to XML docs.I have batched together a PR for these rules as they each had limited existing violations (4 files or less) to resolve. However fixes are arranged per commit so we can easily bikeshed over rules as desired.
See https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ for explanation of each rule.