mirror of
https://github.com/safedep/vet.git
synced 2025-12-10 13:43:01 -06:00
chore: Add option to render markdown summary report from query command
This commit is contained in:
parent
bfa63005e6
commit
b6b0381ef2
15
query.go
15
query.go
@ -21,6 +21,7 @@ var (
|
||||
querySummaryReportMaxAdvice int
|
||||
querySummaryReportGroupByDirectDeps bool
|
||||
queryMarkdownReportPath string
|
||||
queryMarkdownSummaryReportPath string
|
||||
queryJsonReportPath string
|
||||
queryGraphReportPath string
|
||||
queryCsvReportPath string
|
||||
@ -66,6 +67,8 @@ func newQueryCommand() *cobra.Command {
|
||||
"Group summary by direct dependencies")
|
||||
cmd.Flags().StringVarP(&queryMarkdownReportPath, "report-markdown", "", "",
|
||||
"Generate markdown report to file")
|
||||
cmd.Flags().StringVarP(&queryMarkdownSummaryReportPath, "report-markdown-summary", "", "",
|
||||
"Generate markdown summary report to file")
|
||||
cmd.Flags().StringVarP(&queryJsonReportPath, "report-json", "", "",
|
||||
"Generate JSON report to file (EXPERIMENTAL)")
|
||||
cmd.Flags().StringVarP(&queryGraphReportPath, "report-graph", "", "",
|
||||
@ -160,6 +163,18 @@ func internalStartQuery() error {
|
||||
reporters = append(reporters, rp)
|
||||
}
|
||||
|
||||
if !utils.IsEmptyString(queryMarkdownSummaryReportPath) {
|
||||
rp, err := reporter.NewMarkdownSummaryReporter(reporter.MarkdownSummaryReporterConfig{
|
||||
Path: queryMarkdownSummaryReportPath,
|
||||
})
|
||||
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
reporters = append(reporters, rp)
|
||||
}
|
||||
|
||||
if !utils.IsEmptyString(queryJsonReportPath) {
|
||||
rp, err := reporter.NewJsonReportGenerator(reporter.JsonReportingConfig{
|
||||
Path: queryJsonReportPath,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user