Documentation
¶
Overview ¶
Package build implements MDS039, which validates <?build?> directive parameters and keeps the body in sync with the recipe's body-template.
Index ¶
- type Rule
- func (r *Rule) ApplySettings(settings map[string]any) error
- func (r *Rule) Category() string
- func (r *Rule) Check(f *lint.File) []lint.Diagnostic
- func (r *Rule) DefaultSettings() map[string]any
- func (r *Rule) Fix(f *lint.File) []byte
- func (r *Rule) Generate(_ *lint.File, filePath string, line int, params map[string]string, ...) (string, []lint.Diagnostic)
- func (r *Rule) ID() string
- func (r *Rule) Name() string
- func (r *Rule) RuleID() string
- func (r *Rule) RuleName() string
- func (r *Rule) Validate(filePath string, line int, params map[string]string, ...) []lint.Diagnostic
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Rule ¶
type Rule struct {
// contains filtered or unexported fields
}
Rule implements MDS039 (build).
engineOnce serialises lazy engine init; the rule is a registered singleton and concurrent LSP-side callers would otherwise race on the engine field.
func (*Rule) ApplySettings ¶
ApplySettings implements rule.Configurable.
func (*Rule) Check ¶
func (r *Rule) Check(f *lint.File) []lint.Diagnostic
Check implements rule.Rule. It validates each <?build?> directive and reports "generated section is out of date" when the rendered body differs from the expected body-template output. Unknown params are reported as warnings, which the gensection engine cannot emit alongside a stale-body check, so Check is implemented manually.
func (*Rule) DefaultSettings ¶
DefaultSettings implements rule.Configurable.
func (*Rule) Fix ¶
Fix implements rule.FixableRule. The gensection engine regenerates body content for each valid directive.
func (*Rule) Generate ¶
func (r *Rule) Generate( _ *lint.File, filePath string, line int, params map[string]string, _ map[string]gensection.ColumnConfig, ) (string, []lint.Diagnostic)
Generate implements gensection.Directive.
func (*Rule) Validate ¶
func (r *Rule) Validate( filePath string, line int, params map[string]string, _ map[string]gensection.ColumnConfig, ) []lint.Diagnostic
Validate implements gensection.Directive. Returns only hard (error-severity) diagnostics so Fix can regenerate bodies even when unknown params are present.