Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AllRuleNames ¶
AllRuleNames returns the canonical set of known rule names.
func BuildHubViewURL ¶ added in v0.5.0
BuildHubViewURL returns the canonical Hub view URL for a feature README at relPath (relative to the project root, e.g. "spec/features/bots"). host is the Hub base URL without trailing slash.
func RegisterChecker ¶ added in v0.3.3
func RegisterChecker(c Checker)
RegisterChecker registers a custom checker that will run alongside built-in checkers during Lint(). Must be called before any concurrent use of Lint (typically during init or program startup).
func ResetCustomCheckers ¶ added in v0.3.3
func ResetCustomCheckers()
ResetCustomCheckers clears all registered custom checkers (for testing).
func ValidateRuleNames ¶
ValidateRuleNames checks that all names are known rules.
Types ¶
type Checker ¶ added in v0.3.3
type Checker interface {
Name() string
Severity() string
Check(specRoot string) ([]Violation, error)
}
Checker is the public interface for custom rule implementations. External tools can implement this to add custom rules to the linter.
type Options ¶
type Options struct {
SpecRoot string
Rules []string // enabled rules; nil = all
Ignore []string // disabled rules
Severity string // minimum severity: error, warning, info
Fix bool // when true, apply fixes from checkers that support it
}
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 ¶
FilterBySeverity filters violations to those at or above the minimum severity.