Documentation ¶
Index ¶
- Variables
- func HasProjectPoliciesOnDisk(path string) bool
- func RegisterProjectPolicies(path string)
- func RegisterRemoteOPABundleChecks(bundleURLs []string)
- func RunChecksInParallel(checks []Check, checkInput CheckInput, errHandler func(error)) chan []CheckFinding
- func SeverityLevelToName(level int) string
- func SeverityNameToLevel(name string) int
- type BundleCheck
- type Check
- type CheckFinding
- type CheckInput
- type CiYaml
- type GitlabPagesJobCheck
- type InMemoryCheck
- type ModuleCheck
- type PipelineLintApiCheck
- type RemoteBundleCheck
- type ShellScriptCheck
Constants ¶
This section is empty.
Variables ¶
View Source
var SeverityError = 0
View Source
var SeverityInfo = 2
View Source
var SeverityStyle = 3
View Source
var SeverityWarning = 1
Functions ¶
func HasProjectPoliciesOnDisk ¶ added in v1.1.0
func RegisterProjectPolicies ¶ added in v1.1.0
func RegisterProjectPolicies(path string)
func RegisterRemoteOPABundleChecks ¶ added in v1.2.0
func RegisterRemoteOPABundleChecks(bundleURLs []string)
func RunChecksInParallel ¶
func RunChecksInParallel(checks []Check, checkInput CheckInput, errHandler func(error)) chan []CheckFinding
RunChecksInParallel for the given input and handle errors with the callback provided Output is provided in a unbuffered channel that is closed once all checks finished
func SeverityLevelToName ¶
func SeverityNameToLevel ¶
Types ¶
type BundleCheck ¶ added in v1.1.0
type BundleCheck struct {
BundlePath string
}
func (BundleCheck) Run ¶ added in v1.1.0
func (r BundleCheck) Run(i *CheckInput) ([]CheckFinding, error)
type Check ¶
type Check interface { // Run the check Run(i *CheckInput) ([]CheckFinding, error) }
Check that runs verifications
type CheckFinding ¶
type CheckFinding struct { Severity int Code string Line int Message string Link string File string }
func (*CheckFinding) Compare ¶
func (cf *CheckFinding) Compare(o CheckFinding) int
func (*CheckFinding) Location ¶
func (cf *CheckFinding) Location() (string, error)
func (*CheckFinding) SeverityName ¶
func (cf *CheckFinding) SeverityName() string
type CheckInput ¶
type CheckInput struct { // CiYaml contains the yaml configuration in different representations as loaded from the file system CiYaml *CiYaml // Configuration used to execute the verifier Configuration *cli.Configuration // LintAPIResult contains the API response from the GitLab CI Lint API. It might be not set when configuration // disabled ci validation inside CI LintAPIResult *ci_yaml.VerificationResultWithRemoteInfo // MergedCiYaml contains the merged yaml when the lint api result is available MergedCiYaml *CiYaml }
func (*CheckInput) CanProvideMergedYaml ¶ added in v1.0.0
func (c *CheckInput) CanProvideMergedYaml() bool
func (*CheckInput) HasLintAPIResult ¶ added in v1.0.0
func (c *CheckInput) HasLintAPIResult() bool
type GitlabPagesJobCheck ¶
type GitlabPagesJobCheck struct {
InMemoryCheck
}
func NewGitlabPagesJobCheck ¶ added in v1.1.0
func NewGitlabPagesJobCheck() GitlabPagesJobCheck
type InMemoryCheck ¶ added in v1.1.0
type InMemoryCheck struct {
RegoContent string
}
func (InMemoryCheck) Run ¶ added in v1.1.0
func (im InMemoryCheck) Run(i *CheckInput) ([]CheckFinding, error)
type ModuleCheck ¶ added in v1.1.0
type ModuleCheck struct {
ModulePath string
}
func (ModuleCheck) Run ¶ added in v1.1.0
func (m ModuleCheck) Run(i *CheckInput) ([]CheckFinding, error)
type PipelineLintApiCheck ¶
type PipelineLintApiCheck struct { }
func (PipelineLintApiCheck) Run ¶
func (p PipelineLintApiCheck) Run(i *CheckInput) ([]CheckFinding, error)
type RemoteBundleCheck ¶ added in v1.2.0
type RemoteBundleCheck struct {
BundleURL string
}
func (RemoteBundleCheck) Run ¶ added in v1.2.0
func (r RemoteBundleCheck) Run(i *CheckInput) ([]CheckFinding, error)
type ShellScriptCheck ¶
type ShellScriptCheck struct { }
func (ShellScriptCheck) Run ¶
func (s ShellScriptCheck) Run(i *CheckInput) ([]CheckFinding, error)
Click to show internal directories.
Click to hide internal directories.