fsprojects / FSharpLint

Lint tool for F#
https://fsprojects.github.io/FSharpLint/
MIT License
300 stars 73 forks source link

WIP: Add Sarif output support to FSharpLint.Console #702

Open Numpsy opened 3 months ago

Numpsy commented 3 months ago

refs #554

I've recently been having a go at running some things at work through the FSharp.Analyzers.SDK analysis tools and pushing the generated Sarif report files into DevOps CI builds, and I thought it might be useful to see if I could get FSharpLint results pushed out in the same way - so, this is a first attempt at adding Sarif report generation into FSharpLint.Console.

Note: The Sarif writer code is currently a lightly modified version of the report code from https://github.com/ionide/FSharp.Analyzers.SDK just to try to get it working, so if the code style and such is wrong that's the reason.

Numpsy commented 3 months ago

It might also be possible to make it generate a sarif report from the SelfCheck runs in CI builds and push that into the Github code analysis integration, e.g. as done in FsAutoComplete: https://github.com/fsharp/FsAutoComplete/blob/7d2d2ec851392fb7ed08b520a1be7782f24eb3be/.github/workflows/build.yml#L127