⚠️ Removing the confidence field from CheckResult struct (#1896)

- Removing the confidence field from `CheckResult` struct
- https://github.com/ossf/scorecard/issues/1393

Signed-off-by: naveensrinivasan <172697+naveensrinivasan@users.noreply.github.com>
This commit is contained in:
Naveen 2022-05-09 12:46:24 -05:00 committed by GitHub
parent 6d79817e3b
commit 7ff4b7e050
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 16 deletions

View File

@ -81,7 +81,6 @@ type CheckResult struct {
// TODO(#1393): Remove old structure after deprecation.
Name string
Details []string
Confidence int
Pass bool
// UPGRADEv2: New structure. Omitting unchanged Name field
@ -173,7 +172,6 @@ func CreateResultWithScore(name, reason string, score int) CheckResult {
return CheckResult{
Name: name,
// Old structure.
Confidence: MaxResultScore,
Pass: pass,
// New structure.
Version: 2,
@ -197,7 +195,6 @@ func CreateProportionalScoreResult(name, reason string, b, t int) CheckResult {
return CheckResult{
Name: name,
// Old structure.
Confidence: MaxResultConfidence,
Pass: pass,
// New structure.
Version: 2,
@ -228,7 +225,6 @@ func CreateInconclusiveResult(name, reason string) CheckResult {
return CheckResult{
Name: name,
// Old structure.
Confidence: 0,
Pass: false,
// New structure.
Version: 2,
@ -242,7 +238,6 @@ func CreateRuntimeErrorResult(name string, e error) CheckResult {
return CheckResult{
Name: name,
// Old structure.
Confidence: 0,
Pass: false,
// New structure.
Version: 2,

View File

@ -97,7 +97,6 @@ func AsJSON(r *pkg.ScorecardResult, showDetails bool, logLevel log.Level, writer
for _, checkResult := range r.Checks {
tmpResult := jsonCheckResult{
Name: checkResult.Name,
Confidence: checkResult.Confidence,
}
if showDetails {
for i := range checkResult.Details2 {

View File

@ -96,7 +96,6 @@ func (r *ScorecardResult) AsJSON(showDetails bool, logLevel log.Level, writer io
for _, checkResult := range r.Checks {
tmpResult := jsonCheckResult{
Name: checkResult.Name,
Confidence: checkResult.Confidence,
}
if showDetails {
for i := range checkResult.Details2 {