lint

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

README

pkg/lint

Specification linting engine with pluggable rules. Validates spec trees for structural conventions.

Outstanding Questions

None at this time.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AllRuleNames

func AllRuleNames() map[string]bool

AllRuleNames returns the canonical set of known rule names.

func ValidateRuleNames

func ValidateRuleNames(names []string) error

ValidateRuleNames checks that all names are known rules.

Types

type Options

type Options struct {
	SpecRoot string
	Rules    []string // enabled rules; nil = all
	Ignore   []string // disabled rules
	Severity string   // minimum severity: error, warning, info
}

Options holds linting options.

type Violation

type Violation struct {
	File     string `json:"file" yaml:"file"`
	Line     int    `json:"line" yaml:"line"`
	Severity string `json:"severity" yaml:"severity"`
	Rule     string `json:"rule" yaml:"rule"`
	Message  string `json:"message" yaml:"message"`
}

Violation represents a single linting violation.

func FilterBySeverity

func FilterBySeverity(violations []Violation, minSeverity string) []Violation

FilterBySeverity filters violations to those at or above the minimum severity.

func Lint

func Lint(opts Options) ([]Violation, error)

Lint runs all enabled lint rules against the spec tree.

Jump to

Keyboard shortcuts

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