mirror of
https://github.com/ossf/scorecard.git
synced 2024-09-17 11:57:12 +03:00
⚠️ 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:
parent
6d79817e3b
commit
7ff4b7e050
@ -79,10 +79,9 @@ const (
|
|||||||
// nolint:govet
|
// nolint:govet
|
||||||
type CheckResult struct {
|
type CheckResult struct {
|
||||||
// TODO(#1393): Remove old structure after deprecation.
|
// TODO(#1393): Remove old structure after deprecation.
|
||||||
Name string
|
Name string
|
||||||
Details []string
|
Details []string
|
||||||
Confidence int
|
Pass bool
|
||||||
Pass bool
|
|
||||||
|
|
||||||
// UPGRADEv2: New structure. Omitting unchanged Name field
|
// UPGRADEv2: New structure. Omitting unchanged Name field
|
||||||
// for simplicity.
|
// for simplicity.
|
||||||
@ -173,8 +172,7 @@ func CreateResultWithScore(name, reason string, score int) CheckResult {
|
|||||||
return CheckResult{
|
return CheckResult{
|
||||||
Name: name,
|
Name: name,
|
||||||
// Old structure.
|
// Old structure.
|
||||||
Confidence: MaxResultScore,
|
Pass: pass,
|
||||||
Pass: pass,
|
|
||||||
// New structure.
|
// New structure.
|
||||||
Version: 2,
|
Version: 2,
|
||||||
Error: nil,
|
Error: nil,
|
||||||
@ -197,8 +195,7 @@ func CreateProportionalScoreResult(name, reason string, b, t int) CheckResult {
|
|||||||
return CheckResult{
|
return CheckResult{
|
||||||
Name: name,
|
Name: name,
|
||||||
// Old structure.
|
// Old structure.
|
||||||
Confidence: MaxResultConfidence,
|
Pass: pass,
|
||||||
Pass: pass,
|
|
||||||
// New structure.
|
// New structure.
|
||||||
Version: 2,
|
Version: 2,
|
||||||
Error: nil,
|
Error: nil,
|
||||||
@ -228,8 +225,7 @@ func CreateInconclusiveResult(name, reason string) CheckResult {
|
|||||||
return CheckResult{
|
return CheckResult{
|
||||||
Name: name,
|
Name: name,
|
||||||
// Old structure.
|
// Old structure.
|
||||||
Confidence: 0,
|
Pass: false,
|
||||||
Pass: false,
|
|
||||||
// New structure.
|
// New structure.
|
||||||
Version: 2,
|
Version: 2,
|
||||||
Score: InconclusiveResultScore,
|
Score: InconclusiveResultScore,
|
||||||
@ -242,8 +238,7 @@ func CreateRuntimeErrorResult(name string, e error) CheckResult {
|
|||||||
return CheckResult{
|
return CheckResult{
|
||||||
Name: name,
|
Name: name,
|
||||||
// Old structure.
|
// Old structure.
|
||||||
Confidence: 0,
|
Pass: false,
|
||||||
Pass: false,
|
|
||||||
// New structure.
|
// New structure.
|
||||||
Version: 2,
|
Version: 2,
|
||||||
Error: e,
|
Error: e,
|
||||||
|
@ -96,8 +96,7 @@ func AsJSON(r *pkg.ScorecardResult, showDetails bool, logLevel log.Level, writer
|
|||||||
//nolint
|
//nolint
|
||||||
for _, checkResult := range r.Checks {
|
for _, checkResult := range r.Checks {
|
||||||
tmpResult := jsonCheckResult{
|
tmpResult := jsonCheckResult{
|
||||||
Name: checkResult.Name,
|
Name: checkResult.Name,
|
||||||
Confidence: checkResult.Confidence,
|
|
||||||
}
|
}
|
||||||
if showDetails {
|
if showDetails {
|
||||||
for i := range checkResult.Details2 {
|
for i := range checkResult.Details2 {
|
||||||
|
@ -95,8 +95,7 @@ func (r *ScorecardResult) AsJSON(showDetails bool, logLevel log.Level, writer io
|
|||||||
//nolint
|
//nolint
|
||||||
for _, checkResult := range r.Checks {
|
for _, checkResult := range r.Checks {
|
||||||
tmpResult := jsonCheckResult{
|
tmpResult := jsonCheckResult{
|
||||||
Name: checkResult.Name,
|
Name: checkResult.Name,
|
||||||
Confidence: checkResult.Confidence,
|
|
||||||
}
|
}
|
||||||
if showDetails {
|
if showDetails {
|
||||||
for i := range checkResult.Details2 {
|
for i := range checkResult.Details2 {
|
||||||
|
Loading…
Reference in New Issue
Block a user