Documentation
¶
Overview ¶
Package pkg defines fns for running Scorecard checks on a Repo.
Index ¶
- func DetailToString(d *checker.CheckDetail, logLevel log.Level) string
- func FormatResults(opts *options.Options, results *ScorecardResult, doc checks.Doc, ...) error
- type JSONScorecardResultV2
- type RepoInfo
- type ScorecardInfo
- type ScorecardResult
- func (r *ScorecardResult) AsJSON(showDetails bool, logLevel log.Level, writer io.Writer) error
- func (r *ScorecardResult) AsJSON2(showDetails bool, logLevel log.Level, checkDocs docs.Doc, writer io.Writer) error
- func (r *ScorecardResult) AsRawJSON(writer io.Writer) error
- func (r *ScorecardResult) AsSARIF(showDetails bool, logLevel log.Level, writer io.Writer, checkDocs docs.Doc, ...) error
- func (r *ScorecardResult) AsString(showDetails bool, logLevel log.Level, checkDocs checks.Doc, writer io.Writer) error
- func (r *ScorecardResult) GetAggregateScore(checkDocs checks.Doc) (float64, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DetailToString ¶
func DetailToString(d *checker.CheckDetail, logLevel log.Level) string
DetailToString turns a detail information into a string.
func FormatResults ¶ added in v4.2.0
func FormatResults( opts *options.Options, results *ScorecardResult, doc checks.Doc, policy *spol.ScorecardPolicy, ) error
FormatResults formats scorecard results.
Types ¶
type JSONScorecardResultV2 ¶ added in v4.2.0
type JSONScorecardResultV2 struct {
Date string `json:"date"`
Repo jsonRepoV2 `json:"repo"`
Scorecard jsonScorecardV2 `json:"scorecard"`
AggregateScore jsonFloatScore `json:"score"`
Checks []jsonCheckResultV2 `json:"checks"`
Metadata []string `json:"metadata"`
}
JSONScorecardResultV2 exports results as JSON for new detail format.
type ScorecardInfo ¶
ScorecardInfo contains information about the scorecard code that was run.
type ScorecardResult ¶
type ScorecardResult struct {
Repo RepoInfo
Date time.Time
Scorecard ScorecardInfo
Checks []checker.CheckResult
RawResults checker.RawResults
Metadata []string
}
ScorecardResult struct is returned on a successful Scorecard run. nolint
func RunScorecards ¶
func RunScorecards(ctx context.Context, repo clients.Repo, commitSHA string, checksToRun checker.CheckNameToFnMap, repoClient clients.RepoClient, ossFuzzRepoClient clients.RepoClient, ciiClient clients.CIIBestPracticesClient, vulnsClient clients.VulnerabilitiesClient, ) (ScorecardResult, error)
RunScorecards runs enabled Scorecard checks on a Repo.
func (*ScorecardResult) AsJSON2 ¶
func (r *ScorecardResult) AsJSON2(showDetails bool, logLevel log.Level, checkDocs docs.Doc, writer io.Writer, ) error
AsJSON2 exports results as JSON for new detail format.
func (*ScorecardResult) AsRawJSON ¶
func (r *ScorecardResult) AsRawJSON(writer io.Writer) error
AsRawJSON exports results as JSON for raw results.
func (*ScorecardResult) AsSARIF ¶
func (r *ScorecardResult) AsSARIF(showDetails bool, logLevel log.Level, writer io.Writer, checkDocs docs.Doc, policy *spol.ScorecardPolicy, ) error
AsSARIF outputs ScorecardResult in SARIF 2.1.0 format.
func (*ScorecardResult) AsString ¶
func (r *ScorecardResult) AsString(showDetails bool, logLevel log.Level, checkDocs checks.Doc, writer io.Writer, ) error
AsString returns ScorecardResult in string format.
func (*ScorecardResult) GetAggregateScore ¶
func (r *ScorecardResult) GetAggregateScore(checkDocs checks.Doc) (float64, error)
GetAggregateScore returns the aggregate score.