@@ -34,6 +34,7 @@ import (
34
34
pmc "github.com/ossf/scorecard/v5/cmd/internal/packagemanager"
35
35
docs "github.com/ossf/scorecard/v5/docs/checks"
36
36
sce "github.com/ossf/scorecard/v5/errors"
37
+ "github.com/ossf/scorecard/v5/finding"
37
38
sclog "github.com/ossf/scorecard/v5/log"
38
39
"github.com/ossf/scorecard/v5/options"
39
40
"github.com/ossf/scorecard/v5/pkg/scorecard"
@@ -164,9 +165,8 @@ func rootCmd(o *options.Options) error {
164
165
165
166
if o .Format == options .FormatDefault {
166
167
if len (enabledProbes ) > 0 {
167
- printProbeResults (enabledProbes )
168
- } else {
169
- printCheckResults (enabledChecks )
168
+ printProbeResults (enabledProbes , repoResult .Findings )
169
+ return nil
170
170
}
171
171
}
172
172
@@ -180,6 +180,7 @@ func rootCmd(o *options.Options) error {
180
180
return fmt .Errorf ("failed to format results: %w" , resultsErr )
181
181
}
182
182
183
+ printCheckResults (enabledChecks )
183
184
// intentionally placed at end to preserve outputting results, even if a check has a runtime error
184
185
for _ , result := range repoResult .Checks {
185
186
if result .Error != nil {
@@ -201,10 +202,17 @@ func printCheckStart(enabledChecks checker.CheckNameToFnMap) {
201
202
}
202
203
}
203
204
204
- func printProbeResults (enabledProbes []string ) {
205
+ func printProbeResults (enabledProbes []string , findings []finding. Finding ) {
205
206
for _ , probeName := range enabledProbes {
206
207
fmt .Fprintf (os .Stderr , "Finished probe %s\n " , probeName )
207
208
}
209
+ for _ , result := range findings {
210
+ if result .Remediation != nil {
211
+ fmt .Fprintf (os .Stderr , "[%s] Remediation required: %s\n " , result .Probe , result .Remediation .Text )
212
+ } else {
213
+ fmt .Fprintf (os .Stderr , "[%s] Passed: %s\n " , result .Probe , result .Message )
214
+ }
215
+ }
208
216
}
209
217
210
218
func printCheckResults (enabledChecks checker.CheckNameToFnMap ) {
0 commit comments