-
Notifications
You must be signed in to change notification settings - Fork 511
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
✨ Add a --details-format
Option to produce JSON-details
#2910
Conversation
DetailsFormatString = "string" | ||
// DetailsFormatFindings specifies that the details will be reported as "structured" findings | ||
// that are more suited for automated parsing. | ||
DetailsFormatFinding = "finding" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm looking for feedback of what to name this details' format.
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #2910 +/- ##
=======================================
Coverage 52.42% 52.43%
=======================================
Files 158 158
Lines 12108 12146 +38
=======================================
+ Hits 6348 6369 +21
- Misses 5390 5407 +17
Partials 370 370 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm a bit confused at the purpose of this flag.
Do you imagine the need for --format json
users to use the finding
detail format as well? Or for --format structured-json
users to use the string
detail format?
I don't really see a difference in output when running these commands:
SCORECARD_EXPERIMENTAL=1 go run main.go --repo ossf/scorecard --format structured-json --details-format string --show-details
SCORECARD_EXPERIMENTAL=1 go run main.go --repo ossf/scorecard --format structured-json --details-format finding --show-details
@@ -116,7 +116,7 @@ func FormatResults( | |||
// TODO: support config files and update checker.MaxResultScore. | |||
err = results.AsSARIF(opts.ShowDetails, log.ParseLevel(opts.LogLevel), os.Stdout, doc, policy, opts) | |||
case options.FormatJSON: | |||
err = results.AsJSON2(opts.ShowDetails, log.ParseLevel(opts.LogLevel), doc, os.Stdout) | |||
err = results.AsJSON3(opts, log.ParseLevel(opts.LogLevel), doc, os.Stdout) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd be hesitant with this change. I thought this was enabling the JSONScorecardResultV3
for the --format json
users.
This is misleading in my opinion.
Closing this PR. Based on @spencerschrock 's comment, I don't think it's needed. Re-using |
This PR:
--details-format
option to the CLI, gated onSCORECARD_EXPERIMENTAL=1
.