Skip to content

Commit

Permalink
CR
Browse files Browse the repository at this point in the history
  • Loading branch information
EyalDelarea committed Sep 26, 2023
1 parent 2a121de commit 0d65410
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 11 deletions.
1 change: 1 addition & 0 deletions xray/commands/audit/audit.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ func (auditCmd *AuditCommand) Run() (err error) {
SetOutputFormat(auditCmd.OutputFormat()).
SetPrintExtendedTable(auditCmd.PrintExtendedTable).
SetExtraMessages(messages).
SetScanType(services.Dependency).
PrintScanResults(); err != nil {
return
}
Expand Down
22 changes: 11 additions & 11 deletions xray/utils/resultwriter.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,21 +37,21 @@ var CurationOutputFormats = []string{string(Table), string(Json)}
type ResultsWriter struct {
// The scan results.
results *ExtendedScanResults
// simpleJsonError Errors to be added to output of the SimpleJson format.
// SimpleJsonError Errors to be added to output of the SimpleJson format.
simpleJsonError []formats.SimpleJsonError
// format The output format.
// Format The output format.
format OutputFormat
// includeVulnerabilities If true, include all vulnerabilities as part of the output. Else, include violations only.
// IncludeVulnerabilities If true, include all vulnerabilities as part of the output. Else, include violations only.
includeVulnerabilities bool
// includeLicenses If true, also include license violations as part of the output.
// IncludeLicenses If true, also include license violations as part of the output.
includeLicenses bool
// isMultipleRoots multipleRoots is set to true, in case the given results array contains (or may contain) results of several projects (like in binary scan).
// IsMultipleRoots multipleRoots is set to true, in case the given results array contains (or may contain) results of several projects (like in binary scan).
isMultipleRoots bool
// printExtended, If true, show extended results.
// PrintExtended, If true, show extended results.
printExtended bool
// The scanType (binary,docker,dependency)
// The scanType (binary,dependency)
scanType services.ScanType
// messages - Option array of messages, to be displayed if the format is Table
// Messages - Option array of messages, to be displayed if the format is Table
messages []string
}

Expand Down Expand Up @@ -107,7 +107,7 @@ func (rw *ResultsWriter) PrintScanResults() error {
case Table:
return rw.printScanResultsTables()
case SimpleJson:
jsonTable, err := rw.convertScanToSimpleJson(false)
jsonTable, err := rw.convertScanToSimpleJson()
if err != nil {
return err
}
Expand Down Expand Up @@ -328,8 +328,8 @@ func (rw *ResultsWriter) convertXrayScanToSimpleJson(simplifiedOutput bool) (for
return jsonTable, nil
}

func (rw *ResultsWriter) convertScanToSimpleJson(simplifiedOutput bool) (formats.SimpleJsonResults, error) {
jsonTable, err := rw.convertXrayScanToSimpleJson(simplifiedOutput)
func (rw *ResultsWriter) convertScanToSimpleJson() (formats.SimpleJsonResults, error) {
jsonTable, err := rw.convertXrayScanToSimpleJson(false)
if err != nil {
return formats.SimpleJsonResults{}, err
}
Expand Down

0 comments on commit 0d65410

Please sign in to comment.