lint

package
v0.2.0 Latest Latest
Warning

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

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

Documentation

Overview

Package lint provides deterministic linting for OpenAPI specifications.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithDefaults

func WithDefaults(_ context.Context, specBytes []byte, opts *Options) (*types.LintReport, error)

WithDefaults lints using vacuum's built-in recommended ruleset. This is useful when no custom APIStyleSpec is available.

Types

type Linter

type Linter interface {
	// Lint analyzes an OpenAPI specification and returns violations.
	Lint(ctx context.Context, spec []byte, opts *Options) (*types.LintReport, error)
}

Linter defines the interface for OpenAPI specification linting.

type Options

type Options struct {
	// FileName is the path to the specification file (for error reporting).
	FileName string

	// Profile is the style profile name being used.
	Profile string

	// ConformanceLevel is the target conformance level.
	ConformanceLevel string

	// FailFast stops on first error if true.
	FailFast bool

	// Timeout is the maximum duration for linting.
	Timeout int

	// Exceptions is a list of exceptions to apply.
	Exceptions []types.Exception
}

Options configures linting behavior.

func DefaultOptions

func DefaultOptions() *Options

DefaultOptions returns options with sensible defaults.

type VacuumLinter

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

VacuumLinter implements Linter using the vacuum library.

func NewVacuumLinter

func NewVacuumLinter(spec *types.APIStyleSpec) *VacuumLinter

NewVacuumLinter creates a new linter from an APIStyleSpec.

func (*VacuumLinter) Lint

func (l *VacuumLinter) Lint(_ context.Context, specBytes []byte, opts *Options) (*types.LintReport, error)

Lint analyzes an OpenAPI specification and returns violations.

Jump to

Keyboard shortcuts

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