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

Baselining new rules (aka. grandfathering in debt) on a large repo is quite difficult #32102

Open
bichuga opened this issue Jan 2, 2019 · 2 comments
Labels
Area-IDE Need Design Review The end user experience design needs to be reviewed and approved. Story
Milestone

Comments

@bichuga
Copy link

bichuga commented Jan 2, 2019

Version Used:
2.9

Steps to Reproduce:
With the goal of bringing Roslyn Analyzers as a build-breaking code hygiene tool to your large, many-sln codebase....

  1. Wire up Roslyn to run a default set of analyzers as part of every project. This will likely require .targets changes and build.props edits.
  2. Run a build. As expected, the build is broken in potentially thousands of places.
  3. Grandfather in all existing debt.

Expected Behavior:
Feature exists to baseline the entire repo.

Actual Behavior:
No such feature exists.

Since the feature does not yet exist, we built a custom ScopeIdentifier analyzer which generates all of the missing information needed to be able to crunch a Roslyn SARIF file into a LocalSuppressions.cs. We include this scopeidentifier like a normal analyzer <Analyzer Include="…ScopeIdentifier.dll" /> and drop an <errorlog>foo.Sarif</errorlog> during a build. From there we have a Roslyn suppressor tool combine these two files into LocalSuppressions.cs.

@bichuga
Copy link
Author

bichuga commented Jan 2, 2019

Suggestions:

  1. Output the missing scope and target information into the SARIF file.
  2. Build a feature by which Roslyn will generate the suppressions file and update the csproj to include this file. The functionality already exists in VS to do essentially this (via right click -> suppress all in suppressions file). We need this functionality to be available natively in msbuild.

@mavasani
Copy link
Member

Extracted out (1) to #42489

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-IDE Need Design Review The end user experience design needs to be reviewed and approved. Story
Projects
Status: In Queue
IDE: Design review
  
In Queue
Development

No branches or pull requests

4 participants