Skip to content
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

Proposing new Maintainability rule 'Remove unnecessary suppression' same as IDE0079 #6839

Closed
maettu-this opened this issue Aug 6, 2023 · 2 comments

Comments

@maettu-this
Copy link

Maintainability

Describe the problem you are trying to solve

Clean code, minimum of suppressions.

Describe suggestions on how to achieve the rule

IDE0079: Remove unnecessary suppression works fine for IDE.... rules, but not for other analyzers. Proposing to add a new CA.... rule 'Remove unnecessary suppression'.

Additional context

Such new rule could be considered too intrusive. Still, it could be added as "opt-in" rule, i.e. keep disabled by default at first and only later default to enbled once the new rule has been adopted by the majority of users.

@maettu-this
Copy link
Author

maettu-this commented Aug 15, 2023

In the meantime I got told at DotNetAnalyzers/StyleCopAnalyzers#3685 that IDE0079 is supposed to include other analyzers but doesn’t fully work yet. If IDE0079 indeed will cover the Roslyn analyzers, this proposal would be obsolete.

Feel free to keep open until IDE0079 got fixed, or already close it now.

@mavasani
Copy link
Contributor

IDE0079 is a very special analyzer, that is currently IDE-only and relies on non-public Roslyn APIs and functionality. It needs access to all the diagnostics reported by rest of the analyzers, something that a normal analyzer does not have access to (and we don't want them to have such an access either).

Please see the discussion in dotnet/roslyn#41574 for more details on why adding such an analyzer for command line builds is a big challenge, and likely not feasible without adding quite some compiler support and public APIs. Unless that can be done, this issue itself is not actionable. I am going to close this out as Won't Fix. Feel free to file a Roslyn issue to consider adding compiler support and new analyzer APIs to enable authoring such an analyzer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants