Skip to content

Commit

Permalink
Merge pull request #270 from interlynk-io/263-include-sbom-details-wi…
Browse files Browse the repository at this point in the history
…th-b-processing

Add more output to basic
  • Loading branch information
riteshnoronha authored Jun 29, 2024
2 parents 8f9d7e4 + 95b18c3 commit 1f002b9
Showing 1 changed file with 19 additions and 2 deletions.
21 changes: 19 additions & 2 deletions pkg/reporter/basic.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,28 @@

package reporter

import "fmt"
import (
"fmt"
"strings"
)

func (r *Reporter) simpleReport() {
for index, path := range r.Paths {
scores := r.Scores[index]
fmt.Printf("%0.1f\t%s\n", scores.AvgScore(), path)
doc := r.Docs[index]

format := doc.Spec().FileFormat()
spec := doc.Spec().Name()
specVersion := doc.Spec().Version()

if spec == "spdx" {
specVersion = strings.Replace(specVersion, "SPDX-", "", 1)
}

if spec == "cyclonedx" {
spec = "cdx"
}

fmt.Printf("%0.1f\t%s\t%s\t%s\t%s\n", scores.AvgScore(), spec, specVersion, format, path)
}
}

0 comments on commit 1f002b9

Please sign in to comment.