Skip to content

Commit

Permalink
feat: improve cli scan output
Browse files Browse the repository at this point in the history
  • Loading branch information
emmanuelgautier committed Oct 17, 2024
1 parent d9399e6 commit e625fe1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
6 changes: 5 additions & 1 deletion internal/cmd/printtable/report_table.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,12 @@ package printtable
import (
"fmt"
"sort"
"strings"

"github.com/cerberauth/vulnapi/report"
"github.com/olekukonko/tablewriter"
"golang.org/x/text/cases"
"golang.org/x/text/language"
)

type ScanIssueReport struct {
Expand Down Expand Up @@ -85,11 +88,12 @@ func DisplayReportSummaryTable(r *report.Reporter) {
tableColors[0] = tablewriter.Colors{tablewriter.Bold}
tableColors[1] = tablewriter.Colors{tablewriter.Bold}

statusCaser := cases.Title(language.English)

Check warning on line 91 in internal/cmd/printtable/report_table.go

View check run for this annotation

Codecov / codecov/patch

internal/cmd/printtable/report_table.go#L91

Added line #L91 was not covered by tests
for _, status := range report.IssueReportStatuses {
scansNumber := len(r.GetReportsByIssueStatus(status))

row := []string{
status.String(),
statusCaser.String(strings.ToLower(status.String())),

Check warning on line 96 in internal/cmd/printtable/report_table.go

View check run for this annotation

Codecov / codecov/patch

internal/cmd/printtable/report_table.go#L96

Added line #L96 was not covered by tests
fmt.Sprintf("%d", scansNumber),
}

Expand Down
1 change: 0 additions & 1 deletion internal/cmd/printtable/wellknown_paths_table.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ func WellKnownPathsScanReport(reporter *report.Reporter) {
}

if openapiURL == "" && graphqlURL == "" {
fmt.Println("No well-known paths were found.")
return
}

Expand Down

0 comments on commit e625fe1

Please sign in to comment.