Documentation ¶
Overview ¶
Package pkg defines fns for running Scorecard checks on a RepoURL.
Index ¶
- func DetailToString(d *checker.CheckDetail, logLevel zapcore.Level) string
- func GetArch() string
- func GetBuildDate() string
- func GetCommit() string
- func GetCompiler() string
- func GetGoVersion() string
- func GetOS() string
- func GetSemanticVersion() string
- func GetTagVersion() string
- func GetTreeState() string
- type RepoInfo
- type ScorecardInfo
- type ScorecardResult
- func (r *ScorecardResult) AsCSV(showDetails bool, logLevel zapcore.Level, checkDocs docs.Doc, writer io.Writer) error
- func (r *ScorecardResult) AsJSON(showDetails bool, logLevel zapcore.Level, writer io.Writer) error
- func (r *ScorecardResult) AsJSON2(showDetails bool, logLevel zapcore.Level, checkDocs docs.Doc, writer io.Writer) error
- func (r *ScorecardResult) AsSARIF(showDetails bool, logLevel zapcore.Level, writer io.Writer, checkDocs docs.Doc, ...) error
- func (r *ScorecardResult) AsString(showDetails bool, logLevel zapcore.Level, checkDocs docs.Doc, writer io.Writer) error
- func (r *ScorecardResult) GetAggregateScore(checkDocs docs.Doc) (float64, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DetailToString ¶ added in v2.2.3
func DetailToString(d *checker.CheckDetail, logLevel zapcore.Level) string
DetailToString turns a detail information into a string.
func GetArch ¶ added in v2.2.3
func GetArch() string
GetArch returns the architecture (e.g., x86) the build can run on.
func GetBuildDate ¶ added in v2.2.3
func GetBuildDate() string
GetBuildDate returns the date scorecard was build.
func GetCommit ¶ added in v2.2.3
func GetCommit() string
GetCommit returns the GitHub's commit hash that scorecard was built from.
func GetCompiler ¶ added in v2.2.3
func GetCompiler() string
GetCompiler returns the compiler that was used to build scorecard.
func GetGoVersion ¶ added in v2.2.3
func GetGoVersion() string
GetGoVersion returns the Go version used to build scorecard.
func GetSemanticVersion ¶ added in v2.2.8
func GetSemanticVersion() string
GetSemanticVersion returns the semantic version, i.e., X.Y.Z.
func GetTagVersion ¶ added in v2.2.8
func GetTagVersion() string
GetTagVersion returns the scorecard version fr the release GitHub tag, i.e. v.X.Y.Z.
func GetTreeState ¶ added in v2.2.3
func GetTreeState() string
GetTreeState returns the git tree state.
Types ¶
type ScorecardInfo ¶ added in v2.2.3
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 Metadata []string }
ScorecardResult struct is returned on a successful Scorecard run.
func RunScorecards ¶
func RunScorecards(ctx context.Context, repoURL repos.RepoURL, checksToRun checker.CheckNameToFnMap, repoClient clients.RepoClient) (ScorecardResult, error)
RunScorecards runs enabled Scorecard checks on a RepoURL.
func (*ScorecardResult) AsCSV ¶
func (r *ScorecardResult) AsCSV(showDetails bool, logLevel zapcore.Level, checkDocs docs.Doc, writer io.Writer) error
AsCSV outputs ScorecardResult in CSV format.
func (*ScorecardResult) AsJSON2 ¶ added in v2.2.3
func (r *ScorecardResult) AsJSON2(showDetails bool, logLevel zapcore.Level, checkDocs docs.Doc, writer io.Writer) error
AsJSON2 exports results as JSON for new detail format.
func (*ScorecardResult) AsSARIF ¶ added in v2.2.3
func (r *ScorecardResult) AsSARIF(showDetails bool, logLevel zapcore.Level, writer io.Writer, checkDocs docs.Doc, policy *spol.ScorecardPolicy, policyFile string) error
AsSARIF outputs ScorecardResult in SARIF 2.1.0 format.
func (*ScorecardResult) AsString ¶
func (r *ScorecardResult) AsString(showDetails bool, logLevel zapcore.Level, checkDocs docs.Doc, writer io.Writer) error
AsString returns ScorecardResult in string format.
func (*ScorecardResult) GetAggregateScore ¶ added in v2.2.8
func (r *ScorecardResult) GetAggregateScore(checkDocs docs.Doc) (float64, error)
GetAggregateScore returns the aggregate score.