validation

package
v1.10.0 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package validation provides GitLab CI YAML validation using glab CLI.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ValidateOptions

type ValidateOptions struct {
	// IncludeJobs includes all jobs in the validation output
	IncludeJobs bool
	// DryRun performs validation without making any changes
	DryRun bool
	// ProjectPath specifies the GitLab project path for includes resolution
	ProjectPath string
	// Ref specifies the branch/tag for includes resolution
	Ref string
}

ValidateOptions configures validation behavior.

type ValidateResult

type ValidateResult struct {
	Valid      bool     `json:"valid"`
	Errors     []string `json:"errors,omitempty"`
	Warnings   []string `json:"warnings,omitempty"`
	MergedYAML string   `json:"merged_yaml,omitempty"`
}

ValidateResult represents the result of a validation operation.

type Validator

type Validator struct {
	// contains filtered or unexported fields
}

Validator provides GitLab CI YAML validation using glab CLI.

func NewValidator

func NewValidator() *Validator

NewValidator creates a new Validator using the default glab path.

func NewValidatorWithPath

func NewValidatorWithPath(path string) *Validator

NewValidatorWithPath creates a new Validator with a custom glab path.

func (*Validator) CheckAvailable

func (v *Validator) CheckAvailable() error

CheckAvailable verifies that glab CLI is installed and accessible.

func (*Validator) ValidateFile

func (v *Validator) ValidateFile(filePath string, opts ValidateOptions) (*ValidateResult, error)

ValidateFile validates the given YAML file using glab ci lint.

func (*Validator) ValidateYAML

func (v *Validator) ValidateYAML(yaml string, opts ValidateOptions) (*ValidateResult, error)

ValidateYAML validates the given YAML content using glab ci lint.

Jump to

Keyboard shortcuts

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