Skip to content

Commit 7ff4b7e

Browse files
⚠️ Removing the confidence field from CheckResult struct (#1896)
- Removing the confidence field from `CheckResult` struct - #1393 Signed-off-by: naveensrinivasan <172697+naveensrinivasan@users.noreply.github.com>
1 parent 6d79817 commit 7ff4b7e

File tree

3 files changed

+9
-16
lines changed

3 files changed

+9
-16
lines changed

checker/check_result.go

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -79,10 +79,9 @@ const (
7979
// nolint:govet
8080
type CheckResult struct {
8181
// TODO(#1393): Remove old structure after deprecation.
82-
Name string
83-
Details []string
84-
Confidence int
85-
Pass bool
82+
Name string
83+
Details []string
84+
Pass bool
8685

8786
// UPGRADEv2: New structure. Omitting unchanged Name field
8887
// for simplicity.
@@ -173,8 +172,7 @@ func CreateResultWithScore(name, reason string, score int) CheckResult {
173172
return CheckResult{
174173
Name: name,
175174
// Old structure.
176-
Confidence: MaxResultScore,
177-
Pass: pass,
175+
Pass: pass,
178176
// New structure.
179177
Version: 2,
180178
Error: nil,
@@ -197,8 +195,7 @@ func CreateProportionalScoreResult(name, reason string, b, t int) CheckResult {
197195
return CheckResult{
198196
Name: name,
199197
// Old structure.
200-
Confidence: MaxResultConfidence,
201-
Pass: pass,
198+
Pass: pass,
202199
// New structure.
203200
Version: 2,
204201
Error: nil,
@@ -228,8 +225,7 @@ func CreateInconclusiveResult(name, reason string) CheckResult {
228225
return CheckResult{
229226
Name: name,
230227
// Old structure.
231-
Confidence: 0,
232-
Pass: false,
228+
Pass: false,
233229
// New structure.
234230
Version: 2,
235231
Score: InconclusiveResultScore,
@@ -242,8 +238,7 @@ func CreateRuntimeErrorResult(name string, e error) CheckResult {
242238
return CheckResult{
243239
Name: name,
244240
// Old structure.
245-
Confidence: 0,
246-
Pass: false,
241+
Pass: false,
247242
// New structure.
248243
Version: 2,
249244
Error: e,

cron/format/json.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,7 @@ func AsJSON(r *pkg.ScorecardResult, showDetails bool, logLevel log.Level, writer
9696
//nolint
9797
for _, checkResult := range r.Checks {
9898
tmpResult := jsonCheckResult{
99-
Name: checkResult.Name,
100-
Confidence: checkResult.Confidence,
99+
Name: checkResult.Name,
101100
}
102101
if showDetails {
103102
for i := range checkResult.Details2 {

pkg/json.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,7 @@ func (r *ScorecardResult) AsJSON(showDetails bool, logLevel log.Level, writer io
9595
//nolint
9696
for _, checkResult := range r.Checks {
9797
tmpResult := jsonCheckResult{
98-
Name: checkResult.Name,
99-
Confidence: checkResult.Confidence,
98+
Name: checkResult.Name,
10099
}
101100
if showDetails {
102101
for i := range checkResult.Details2 {

0 commit comments

Comments
 (0)