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

Enhance compiler's SARIF errorlog to emit containing symbol information for each reported diagnostic #42489

Open
mavasani opened this issue Mar 17, 2020 · 1 comment

Comments

@mavasani
Copy link
Contributor

Extracted out from #32102

Context

We have got lot of internal feature requests where a team wants to enable new analyzer package on their repo, and wants to generate a baseline of all the existing analyzer violations using a custom command line tool. The current baselining support in Visual Studio only works on individual projects/solutions and also needs the build administrator to open each solution in Visual Studio and manually perform a baseline operation. This is not feasible for big repos, especially as they keep adding new analyzer packages and/or move to new version of analyzer packages and want to repeat the baseline operation. Hence, the request is to provide richer symbolic information for diagnostics in SARIF errorlog output of the compiler, so that they can author a custom command line tool that operates directly off this error log output to generate global SuppressMessage attributes in a suppressions file which can suppress each of the reported diagnostics.

Compiler Feature Request

Enhance the /errorlog command line switch (or provide a new command line switch) so that the SARIF output contains the following additional information for each reported diagnostic:

  1. Symbol kind of the containing symbol of the diagnostic location
  2. Documentation Comment ID of the containing symbol of the diagnostic location

Above information can be easily mapped to the target string and scope for suppress message attributes that can suppress corresponding diagnostic instance.

@paulomorgado
Copy link

I have a tool consuming the SARIF that needs, for each result (error/warning):

  • Assembly name
  • Type name
    • With namespace
  • Member name
    • With type name
      • With namespace

I had to build analyzers to produce this information. It would be great to have it out of the box.

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