pkg

package
v2.1.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 9, 2021 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Overview

Package pkg defines fns for running Scorecard checks on a RepoURL.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ScorecardResult

type ScorecardResult struct {
	Repo     string
	Date     string
	Checks   []checker.CheckResult
	Metadata []string
}

ScorecardResult struct is returned on a successful Scorecard run.

func RunScorecards

func RunScorecards(ctx context.Context,
	repo repos.RepoURL,
	checksToRun checker.CheckNameToFnMap,
	repoClient clients.RepoClient,
	httpClient *http.Client,
	githubClient *github.Client,
	graphClient *githubv4.Client) (ScorecardResult, error)

RunScorecards runs enabled Scorecard checks on a RepoURL.

func (*ScorecardResult) AsCSV

func (r *ScorecardResult) AsCSV(showDetails bool, logLevel zapcore.Level, writer io.Writer) error

AsCSV outputs ScorecardResult in CSV format.

func (*ScorecardResult) AsJSON

func (r *ScorecardResult) AsJSON(showDetails bool, logLevel zapcore.Level, writer io.Writer) error

AsJSON outputs the result in JSON format with a newline at the end. If called on []ScorecardResult will create NDJson formatted output.

func (*ScorecardResult) AsString

func (r *ScorecardResult) AsString(showDetails bool, logLevel zapcore.Level, writer io.Writer) error

AsString returns ScorecardResult in string format.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL