validate

package
v1.223.1-rc.2 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package validate defines the extension point for native CI validators.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Names

func Names() []string

Names returns registered validator names in stable order.

func Register

func Register(validator Validator)

Register makes a validator available to CI commands. It panics for an invalid registration because registrations occur during package setup and a duplicate would otherwise make command behavior non-deterministic.

func Text

func Text(report validation.Report) string

Text renders diagnostics in a stable file:line:column form suitable for terminal and CI UI output.

func WriteText

func WriteText(writer io.Writer, report validation.Report) error

WriteText writes Text to an arbitrary writer for callers that need a raw, pipeable representation.

Types

type Request

type Request struct {
	Root         string
	Paths        []string
	WorkflowPath string
}

Request identifies the repository and optional workflow selection a validator should check. An empty Paths slice and WorkflowPath requests the validator's repository-wide default discovery behavior.

type Validator

type Validator interface {
	Name() string
	Validate(ctx context.Context, request Request) (validation.Report, error)
}

Validator runs one kind of CI validation and returns provider-neutral diagnostics. New validators can register themselves without changing the command layer.

func Get

func Get(name string) (Validator, bool)

Get returns a registered validator by name.

Directories

Path Synopsis
Package githubactions implements GitHub Actions workflow validation.
Package githubactions implements GitHub Actions workflow validation.

Jump to

Keyboard shortcuts

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