-
Notifications
You must be signed in to change notification settings - Fork 4k
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
IDE0058 should offer excluded_symbol_names configuration #57297
Comments
IDExxxx code style rules are implemented in Roslyn repo, moving.. |
I'm a bit concerned that the option presented might not be sufficient to support enabling IDE0058 at warning severity. I'd be very interested in seeing a test performed (e.g. via a diagnostic suppressor) to try and validate how many false positives remain in real-world code bases after implementing this exclusion. |
@shuebner Here's an example of a diagnostic suppressor we created to allow a rule (VSTHRD200) to be used in a context where it wasn't originally intended (microsoft/vs-threading#670): |
I am not following. At the extreme you would list all types on which IDE0058 reports in the current solution. No false positives remain. Then, when you ignore a return value from a new type, that is a new warning, i. e. we err on the safe side. If it is another false positive from a builder or fluent api, you add the type to excluded_symbol_names. I do not see the problem here. I assume the suppressor was for scenarios where test classes are not in their own file system folder and can thus not have their own .editorconfig? |
Can you provide a bit more information about how this could be reused in any project to disable this rule (VSTHRD200) in this specific test context? |
@ggirard07 before going down the diagnostic suppressor road, please be aware that diagnostic suppressors pretty much only work with the dotnet CLI and VS for Windows. |
Duplicate of #47832. |
Analyzer
Diagnostic ID: IDE0058
Describe the improvement
I would like to enable IDE0058 with warning severity.
However, that leads to a lot of useless warnings for any kind of builder, e. g. StringBuilder.
I would like to be able to exclude types like StringBuilder from IDE0058.
Describe suggestions on how to achieve the rule
Offer excluded_symbol_names configuration for IDE0058
Additional context
The text was updated successfully, but these errors were encountered: