lint

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package lint validates visionspec directory structure and naming conventions.

Index

Constants

View Source
const (
	RuleProjectNaming      = "project-naming"
	RuleDirectoryStructure = "directory-structure"
	RuleSpecNaming         = "spec-naming"
	RuleConfigExists       = "config-exists"
	RuleRepoLevelNaming    = "repo-level-naming"
	RuleEvalNaming         = "eval-naming"
	RuleUnknownFile        = "unknown-file"
)

Rules

Variables

This section is empty.

Functions

This section is empty.

Types

type Finding

type Finding struct {
	Path     string   `json:"path"`
	Rule     string   `json:"rule"`
	Message  string   `json:"message"`
	Severity Severity `json:"severity"`
}

Finding represents a single lint issue.

type Linter

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

Linter validates visionspec projects.

func New

func New(specsDir string) *Linter

New creates a new Linter for the given specs directory.

func NewWithConfig

func NewWithConfig(specsDir string, specConfig *types.SpecConfig) *Linter

NewWithConfig creates a new Linter with a custom spec configuration.

func (*Linter) LintAll

func (l *Linter) LintAll() (*Result, error)

LintAll validates all projects in the specs directory.

func (*Linter) LintProject

func (l *Linter) LintProject(name, path string) (*Result, error)

LintProject validates a single project.

type Result

type Result struct {
	Project  string    `json:"project"`
	Findings []Finding `json:"findings"`
	Errors   int       `json:"errors"`
	Warnings int       `json:"warnings"`
	Passed   bool      `json:"passed"`
}

Result contains the complete lint output.

func (*Result) FormatText

func (r *Result) FormatText() string

FormatText renders the result as terminal text.

type Severity

type Severity string

Severity levels for lint findings.

const (
	SeverityError   Severity = "error"
	SeverityWarning Severity = "warning"
	SeverityInfo    Severity = "info"
)

Jump to

Keyboard shortcuts

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