-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Proposal: sub-diagnostics for finer granularity severity configuration #27712
Comments
Dumb question: why |
If we implement this, it should use a '-' as a separator, similar to category based configuration: |
So how can I upvote this? |
I don't think I would be very valuable but @sharwell I'd be happy to help (if you need some). |
I believe this can be trivially implemented once #69843 goes in. We also don't need |
Currently, the upcoming .editorconfig support in the compiler allows diagnostic severities to be configured as follows:
dotnet_diagnostic.xUnit2017.severity = warning
This behavior is not flexible enough to support cases where the same diagnostic ID needs to be reported with different severity values depending on context. One example where this appears today is naming convention rules.
I propose extending the diagnostic ID form from the current
[Identifier]
to also allow[Identifier]+[SubIdentifier]
. If a diagnostic is reported using the optional sub-identifier, the severity will be used for the sub-identifier case, if available. In all cases, the UI and compiler output would omit the sub-identifier from reporting.The
SuppressMessageAttribute.MessageId
property could be used for a targeted suppression of a specific sub-identifier.The text was updated successfully, but these errors were encountered: