diff --git a/cmd/root.go b/cmd/root.go index 4cf2f620238..0fa55156524 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -34,6 +34,7 @@ import ( pmc "github.com/ossf/scorecard/v5/cmd/internal/packagemanager" docs "github.com/ossf/scorecard/v5/docs/checks" sce "github.com/ossf/scorecard/v5/errors" + "github.com/ossf/scorecard/v5/finding" sclog "github.com/ossf/scorecard/v5/log" "github.com/ossf/scorecard/v5/options" "github.com/ossf/scorecard/v5/pkg/scorecard" @@ -164,7 +165,8 @@ func rootCmd(o *options.Options) error { if o.Format == options.FormatDefault { if len(enabledProbes) > 0 { - printProbeResults(enabledProbes) + printProbeResults(enabledProbes, repoResult.Findings) + return nil } else { printCheckResults(enabledChecks) } @@ -201,10 +203,19 @@ func printCheckStart(enabledChecks checker.CheckNameToFnMap) { } } -func printProbeResults(enabledProbes []string) { +func printProbeResults(enabledProbes []string, findings []finding.Finding) { for _, probeName := range enabledProbes { fmt.Fprintf(os.Stderr, "Finished probe %s\n", probeName) } + for _, result := range findings { + if result.Remediation != nil { + // Remediation is indicative of a bad result. + // This output is a light alternative to the details provided by --format=probe + fmt.Fprintf(os.Stderr, "[%s] Remediation required: %s\n", result.Probe, result.Remediation.Text) + } else { + fmt.Fprintf(os.Stderr, "[%s] Passed: %s\n", result.Probe, result.Message) + } + } } func printCheckResults(enabledChecks checker.CheckNameToFnMap) {