Skip to content

Commit

Permalink
log negative findings
Browse files Browse the repository at this point in the history
Signed-off-by: AdamKorcz <[email protected]>
  • Loading branch information
AdamKorcz committed Oct 11, 2023
1 parent 099185c commit 148801e
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 3 deletions.
11 changes: 11 additions & 0 deletions checks/evaluation/finding.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,14 @@ func nonNegativeFindings(findings []finding.Finding) []finding.Finding {
}
return ff
}

func negativeFindings(findings []finding.Finding) []finding.Finding {
var ff []finding.Finding
for i := range findings {
f := &findings[i]
if f.Outcome == finding.OutcomeNegative {
ff = append(ff, *f)
}
}
return ff
}
2 changes: 1 addition & 1 deletion checks/evaluation/packaging.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,6 @@ func Packaging(name string,
}
}

checker.LogFindings(nonNegativeFindings(findings), dl)
checker.LogFindings(negativeFindings(findings), dl)
return checker.CreateMinScoreResult(name, "project is not published as package")
}
3 changes: 2 additions & 1 deletion checks/evaluation/packaging_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@ func TestPackaging(t *testing.T) {
},
},
result: scut.TestReturn{
Score: checker.MinResultScore,
Score: checker.MinResultScore,
NumberOfWarn: 1,
},
},
{
Expand Down
1 change: 0 additions & 1 deletion probes/entries.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ import (
"github.com/ossf/scorecard/v4/probes/fuzzedWithPythonAtheris"
"github.com/ossf/scorecard/v4/probes/fuzzedWithRustCargofuzz"
"github.com/ossf/scorecard/v4/probes/fuzzedWithSwiftLibFuzzer"
"github.com/ossf/scorecard/v4/probes/packagedWithGithubActions"
"github.com/ossf/scorecard/v4/probes/packagedNpmWithGitHubWorkflow"
"github.com/ossf/scorecard/v4/probes/securityPolicyContainsLinks"
"github.com/ossf/scorecard/v4/probes/securityPolicyContainsText"
Expand Down

0 comments on commit 148801e

Please sign in to comment.