Documentation
¶
Overview ¶
Package rulepack configures built-in and customer analyzers through one registry.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AdaptSchemaRule ¶
func AdaptSchemaRule(rule linter.SchemaRule) linter.Analyzer
AdaptSchemaRule gives standalone-schema checks the same rule-pack handling.
func DecodeOptions ¶
DecodeOptions gives third-party checks the same strict option validation as stock checks.
func RegisterStock ¶
Types ¶
type Factory ¶
type Factory func(yaml.Node) (interfaces.Analyzer, error)
Factory constructs a check using validated customer options.
type Pack ¶
type Pack struct {
Version int `yaml:"version"`
Rules []Rule `yaml:"rules"`
Suppressions []Suppression `yaml:"suppressions,omitempty"`
}
Pack is the versioned customer rule configuration.
func DefaultPack ¶
func DefaultPack() Pack
type Program ¶
type Program struct {
// contains filtered or unexported fields
}
Program is a validated rule pack ready to run on parsed documents.
func (*Program) Run ¶
func (p *Program) Run(ctx context.Context, root string, documents []*interfaces.Document) ([]interfaces.Diagnostic, error)
Run executes checks with identical scoping, identity, severity and suppression handling.
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
Registry holds factories registered by either the application or its extensions.
func NewRegistry ¶
func NewRegistry() *Registry
type Rule ¶
type Rule struct {
ID string `yaml:"id"`
Check string `yaml:"check"`
Description string `yaml:"description,omitempty"`
Severity interfaces.Severity `yaml:"severity,omitempty"`
Include []string `yaml:"include,omitempty"`
Exclude []string `yaml:"exclude,omitempty"`
Options yaml.Node `yaml:"options,omitempty"`
}
Rule assigns an identity, severity, scope and options to a registered check.