Skip to content

Commit e1dd80e

Browse files
Included the JSON formatting for cron
Signed-off-by: naveensrinivasan <172697+naveensrinivasan@users.noreply.github.com>
1 parent 7c61bb6 commit e1dd80e

File tree

3 files changed

+3
-0
lines changed

3 files changed

+3
-0
lines changed

cron/internal/format/json.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ type jsonScorecardResultV2 struct {
8686
// AsJSON exports results as JSON for new detail format.
8787
func AsJSON(r *pkg.ScorecardResult, showDetails bool, logLevel log.Level, writer io.Writer) error {
8888
encoder := json.NewEncoder(writer)
89+
encoder.SetIndent("", " ")
8990

9091
out := jsonScorecardResult{
9192
Repo: r.Repo.Name,

cron/internal/format/json_raw_results.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,7 @@ func fillJSONRawResults(r *jsonScorecardRawResult, raw *checker.RawResults) erro
265265
// AsRawJSON exports results as JSON for raw results.
266266
func AsRawJSON(r *pkg.ScorecardResult, writer io.Writer) error {
267267
encoder := json.NewEncoder(writer)
268+
encoder.SetIndent("", " ")
268269
out := jsonScorecardRawResult{
269270
Repo: jsonRepoV2{
270271
Name: r.Repo.Name,

pkg/json.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ type JSONScorecardResultV2 struct {
8686
// AsJSON exports results as JSON for new detail format.
8787
func (r *ScorecardResult) AsJSON(showDetails bool, logLevel log.Level, writer io.Writer) error {
8888
encoder := json.NewEncoder(writer)
89+
encoder.SetIndent("", " ")
8990

9091
out := jsonScorecardResult{
9192
Repo: r.Repo.Name,

0 commit comments

Comments
 (0)