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

IDE0079 (remove unnecessary suppressions) does not work when EnforceCodeStyleInBuild is enabled #47942

Closed
mavasani opened this issue Sep 22, 2020 · 1 comment · Fixed by #47944
Assignees
Milestone

Comments

@mavasani
Copy link
Contributor

mavasani commented Sep 22, 2020

Version Used: VS2019 16.8 P3

Steps to Reproduce:

  1. Create a net5.0 class library project
#pragma warning disable UnknownId1 // IDE0079

[System.Diagnostics.CodeAnalysis.SuppressMessage("Category", "UnknownId2")]  // IDE0079
public class C { }
  1. Verify the pragma and suppress message attribute gets faded with IDE0079
  2. Either install the CodeStyle NuGet package from here or set EnforceCodeStyleInBuild to true

Expected Behavior:
IDE0079 is reported

Actual Behavior:
IDE0079 is not reported

This is a special IDE-only analyzer that should not be exported in the CodeStyle NuGet package. We still want to retain the code in the shared analyzer layer to allow different analyzer hosts to be able to explicitly instantiate it and enforce it on command line.

@mavasani mavasani added this to the 16.8.P4 milestone Sep 22, 2020
@mavasani mavasani self-assigned this Sep 22, 2020
mavasani added a commit to mavasani/roslyn that referenced this issue Sep 22, 2020
…odeStyle layer

Fixes dotnet#47942
This is a special IDE-only analyzer that should not be exported in the CodeStyle NuGet package. We still want to retain the code in the shared analyzer layer to allow different analyzer hosts to be able to explicitly instantiate it and enforce it on command line from the CodeStyle package.
@mavasani
Copy link
Contributor Author

Fixed with #47944

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

Successfully merging a pull request may close this issue.

1 participant