Allow the --sarif flag to accept an optional filename
#2159
Replies: 2 comments
-
|
Thanks for this idea. It is an interesting one. I certainly see the benefit of being able to get a SARIF export and also a human readable report without needing to re-run the analysis. I don't think we currently have any arguments which have an optional value. I think the next step here is to look at the argument parser Crate we use, clap, and see if it supports this. |
Beta Was this translation helpful? Give feedback.
-
|
I would like to support that request. I was really wondering that no report can be generated by the Qlty CLI using Without a report it is hard to apply further processing (e.g. make other automated decisions) Other tools allow to generate reports in different formats (e.g. JSON, HTML, etc) |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Problem statement
Currently, the
--sarifflag is a boolean that only prints the SARIF report to the console. There is no way to specify a filename for the SARIF output, nor is it possible to receive both a SARIF report and a human-readable text report at the same time.When using
--sarif, the usual aggregated, human-friendly issue summary is not shown. The existing--summaryflag only provides a minimal statistic (number of issues), which is insufficient for many use cases.My use case is to run it during ci/cd pipeline, upload sarif report to gitlab artifacts , while in console log have ability a quick look on errors via human readable output
Solution brainstorm (optional)
--sarifflag to accept an optional filename, so users can direct the SARIF output to a file.--sarifflag was not set.Examples:
qlty check --sarif filename.sarifWrites the SARIF report to a file, and the human-readable report to the console.
qlty check --sarifWrites the SARIF report to the console.
qlty checkWrites the human-readable report to the console, with no SARIF file.
Alternatively, an additional flag could be introduced to allow human-readable reports to be written to a file.
Beta Was this translation helpful? Give feedback.
All reactions