lint

package
v1.38.0 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LintVersion = "1.0.0"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Lint

type Lint struct {
	Version        string             `yaml:"lintVersion"`
	DefaultRuleset string             `yaml:"defaultRuleset"`
	Rulesets       map[string]Ruleset `yaml:"rulesets"`
}

func Load

func Load(searchDirs []string) (*Lint, string, error)

type Rule added in v1.31.9

type Rule struct {
	Id                 string         `json:"id,omitempty" yaml:"id,omitempty"`
	Description        string         `json:"description,omitempty" yaml:"description,omitempty"`
	Message            string         `json:"message,omitempty" yaml:"message,omitempty"`
	Given              interface{}    `json:"given,omitempty" yaml:"given,omitempty"`
	Formats            []string       `json:"formats,omitempty" yaml:"formats,omitempty"`
	Resolved           bool           `json:"resolved,omitempty" yaml:"resolved,omitempty"`
	Recommended        bool           `json:"recommended,omitempty" yaml:"recommended,omitempty"`
	Type               string         `json:"type,omitempty" yaml:"type,omitempty"`
	Severity           string         `json:"severity,omitempty" yaml:"severity,omitempty"`
	Then               interface{}    `json:"then,omitempty" yaml:"then,omitempty"`
	PrecompiledPattern *regexp.Regexp `json:"-" yaml:"-"` // regex is slow.
	RuleCategory       *RuleCategory  `json:"category,omitempty" yaml:"category,omitempty"`
	Name               string         `json:"-" yaml:"-"`
	HowToFix           string         `json:"howToFix,omitempty" yaml:"howToFix,omitempty"`
}

Rule is a structure that represents a rule as part of a ruleset.

type RuleCategory added in v1.31.9

type RuleCategory struct {
	Id          string `json:"id" yaml:"id"`                   // The category ID
	Name        string `json:"name" yaml:"name"`               // The name of the category
	Description string `json:"description" yaml:"description"` // What is the category all about?
}

RuleCategory is a structure that represents a category of rules.

type Ruleset

type Ruleset struct {
	Rulesets []string         `yaml:"rulesets"`
	Rules    map[string]*Rule `yaml:"rules"`
}

Jump to

Keyboard shortcuts

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