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" // FlagNuget is the flag name for specifying a Nuget repository. FlagNuget = "nuget" // 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" // FlagShowAnnotations is the flag name for outputting annotations on checks. FlagShowAnnotations = "show-annotations" // 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" // FlagResultsFile is the flag name for specifying output file. FlagResultsFile = "output" // ShorthandFlagResultsFile is the shorthand flag name for specifying output file. ShorthandFlagResultsFile = "o" FlagCommitDepth = "commit-depth" FlagProbes = "probes" )
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" // FormatProbe specifies that results should be output in probe JSON format. FormatProbe = "probe" // 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" // EnvVarScorecardExperimental is the environment variable which enables experimental // features. EnvVarScorecardExperimental = "SCORECARD_EXPERIMENTAL" )
Variables ¶
View Source
var ( // DefaultLogLevel retrieves the default log level. DefaultLogLevel = sclog.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 Nuget string PolicyFile string ResultsFile string ChecksToRun []string ProbesToRun []string Metadata []string CommitDepth int ShowDetails bool ShowAnnotations bool // Feature flags. EnableSarif bool `env:"ENABLE_SARIF"` EnableScorecardV6 bool `env:"SCORECARD_V6"` EnableScorecardExperimental bool `env:"SCORECARD_EXPERIMENTAL"` }
Options define common options for configuring scorecard.
func (*Options) IsInternalGitHubIntegrationEnabled ¶
GitHub integration support. See https://github.com/ossf/scorecard-action/issues/1107. NOTE: We don't add a field to to the Option structure to simplify integration. If we did, the Action would also need to be aware of the integration and pass the relevant values. This would add redundancy and complicate maintenance.
Click to show internal directories.
Click to hide internal directories.