Documentation
¶
Overview ¶
Package options implements Scorecard options.
Index ¶
Constants ¶
View Source
const ( // FlagRepo is the flag name for specifying a repository. FlagRepo = "repo" // FlagLocal is the flag name for specifying a local run. FlagLocal = "local" // FlagCommit is the flag name for specifying a commit. FlagCommit = "commit" // FlagLogLevel is the flag name for specifying the log level. FlagLogLevel = "verbosity" // FlagNPM is the flag name for specifying a NPM repository. FlagNPM = "npm" // FlagPyPI is the flag name for specifying a PyPI repository. FlagPyPI = "pypi" // FlagRubyGems is the flag name for specifying a RubyGems repository. FlagRubyGems = "rubygems" // FlagMetadata is the flag name for specifying metadata for the project. FlagMetadata = "metadata" // FlagShowDetails is the flag name for outputting additional check info. FlagShowDetails = "show-details" // FlagChecks is the flag name for specifying which checks to run. FlagChecks = "checks" // FlagPolicyFile is the flag name for specifying a policy file. FlagPolicyFile = "policy" // FlagFormat is the flag name for specifying output format. FlagFormat = "format" FlagCommitDepth = "commit-depth" )
View Source
const ( // DefaultCommit specifies the default commit reference to use. DefaultCommit = clients.HeadSHA // Formats. // FormatJSON specifies that results should be output in JSON format. FormatJSON = "json" // FormatSarif specifies that results should be output in SARIF format. FormatSarif = "sarif" // FormatDefault specifies that results should be output in default format. FormatDefault = "default" // FormatRaw specifies that results should be output in raw format. FormatRaw = "raw" // Environment variables. // EnvVarEnableSarif is the environment variable which controls enabling // SARIF logging. EnvVarEnableSarif = "ENABLE_SARIF" // EnvVarScorecardV6 is the environment variable which enables scorecard v6 // options. EnvVarScorecardV6 = "SCORECARD_V6" )
Variables ¶
View Source
var ( // DefaultLogLevel retrieves the default log level. DefaultLogLevel = log.DefaultLevel.String() )
Functions ¶
This section is empty.
Types ¶
type Command ¶
type Command interface {
// AddFlags adds this options' flags to the cobra command.
AddFlags(cmd *cobra.Command)
}
Command is an interface for handling options for command-line utilities.
type Options ¶
type Options struct {
Repo string
Local string
Commit string
LogLevel string
Format string
NPM string
PyPI string
RubyGems string
PolicyFile string
// TODO(action): Add logic for writing results to file
ResultsFile string
ChecksToRun []string
Metadata []string
CommitDepth int
ShowDetails bool
// Feature flags.
EnableSarif bool `env:"ENABLE_SARIF"`
EnableScorecardV6 bool `env:"SCORECARD_V6"`
}
Options define common options for configuring scorecard.
Click to show internal directories.
Click to hide internal directories.