checks

package
v0.0.12 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2024 License: GPL-3.0 Imports: 18 Imported by: 0

Documentation

Index

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 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 SeverityLevelToName(level int) string

func SeverityNameToLevel

func SeverityNameToLevel(name string) int

Types

type Check

type Check interface {
	// Run the check
	Run(i *CheckInput) ([]CheckFinding, error)
}

Check that runs verifications

func AllChecks

func AllChecks() []Check

AllChecks available

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        *CiYaml
	Configuration *cli.Configuration
}

type CiYaml

type CiYaml struct {
	FileContent   []byte
	ParsedYamlMap map[string]any
	ParsedYamlDoc *yaml.Node
}

func NewCiYaml

func NewCiYaml(content []byte) (*CiYaml, error)

NewCiYaml from byte contents

type GitlabPagesJobCheck

type GitlabPagesJobCheck struct{}

func (GitlabPagesJobCheck) Run

type PipelineLintApiCheck

type PipelineLintApiCheck struct {
}

func (PipelineLintApiCheck) Run

type ShellScriptCheck

type ShellScriptCheck struct {
}

func (ShellScriptCheck) Run

Jump to

Keyboard shortcuts

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