rrrene / credo

A static code analysis tool for the Elixir language with a focus on code consistency and teaching.
http://credo-ci.org/
MIT License
4.93k stars 417 forks source link

Add SARIF support #1011

Closed shaopeng-gh closed 1 year ago

shaopeng-gh commented 1 year ago

Please see discussion thread: https://github.com/rrrene/credo-proposals/issues/58

@michaelcfanning @EasyRhinoMSFT @rrrene

rrrene commented 1 year ago

Thanks for putting this together :+1:

shaopeng-gh commented 1 year ago

I have a few improvements need to make per Michael's input, will be back with a new commit:

  1. In the result node, remove the redundant level: warning.
  2. The description of the checks looks like is in markdown format, in SARFI message have a node markdown to put it in. This will be for the rendering tools that can render markdown. And in text field we will also set it, but replacing the ` This will be for the rendering tools that can not render markdown or choose to render the text field.
shaopeng-gh commented 1 year ago

fyi see a possible issue, noted down seperatly here: https://github.com/rrrene/credo/issues/1017

shaopeng-gh commented 1 year ago

Used the id you provided, thanks!

michaelcfanning commented 1 year ago

@shaopeng-gh, just checking with you, are we code complete with this proposal? i.e., you have implemented all the changes we discussed offline? Really appreciate your work her, this will make a difference to Elixir devs, particularly those interacting with GHAS.

@osfernandez

shaopeng-gh commented 1 year ago

@shaopeng-gh, just checking with you, are we code complete with this proposal? i.e., you have implemented all the changes we discussed offline? Really appreciate your work her, this will make a difference to Elixir devs, particularly those interacting with GHAS.

@osfernandez

Yes Michael. The last change was @rrrene kindly provided rule id and rule name and I have used it in the SARIF. @rrrene let me know if you can approve the pr, thanks,

michaelcfanning commented 1 year ago

That's great! This is very nice work. I know for a fact there are several eager customers out there who plan to use this new reporting capability. :)

rrrene commented 1 year ago

This is part of Credo v1.7.0-rc.1 :+1: