catalog

package
v0.23.0 Latest Latest
Warning

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

Go to latest
Published: May 21, 2026 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Rule

type Rule struct {
	Pad            int
	SeparatorStyle tablefmt.SeparatorStyle
	// contains filtered or unexported fields
}

Rule checks that generated sections match their directive output.

engineOnce serialises the lazy initialisation of engine: the rule is a registered singleton and the LSP server may call Check from multiple goroutines, so a plain check-then-set on the engine field races. sync.Once gives both writers and readers a single happens-before edge.

Pad and SeparatorStyle mirror MDS025 (table-format)'s knobs and govern only the tables this rule emits inside `<?catalog?>` bodies. Catalog carries its own copies — rather than reading MDS025's configured state — because the lint engine clones rules and applies settings per file in parallel; a process-global view of MDS025 would race across workers. Set both rules to the same style when you want host-file tables and catalog-generated tables to share a canonical.

func (*Rule) ApplySettings added in v0.23.0

func (r *Rule) ApplySettings(s map[string]any) error

ApplySettings implements rule.Configurable.

func (*Rule) Category

func (r *Rule) Category() string

Category implements rule.Rule.

func (*Rule) Check

func (r *Rule) Check(f *lint.File) []lint.Diagnostic

Check implements rule.Rule.

func (*Rule) DefaultSettings added in v0.23.0

func (r *Rule) DefaultSettings() map[string]any

DefaultSettings implements rule.Configurable.

func (*Rule) Fix

func (r *Rule) Fix(f *lint.File) []byte

Fix implements rule.FixableRule.

func (*Rule) Generate

func (r *Rule) Generate(f *lint.File, filePath string, line int,
	params map[string]string, columns map[string]gensection.ColumnConfig,
) (string, []lint.Diagnostic)

Generate implements gensection.Directive.

func (*Rule) ID

func (r *Rule) ID() string

ID implements rule.Rule.

func (*Rule) Name

func (r *Rule) Name() string

Name implements rule.Rule.

func (*Rule) RuleID

func (r *Rule) RuleID() string

RuleID implements gensection.Directive.

func (*Rule) RuleName

func (r *Rule) RuleName() string

RuleName implements gensection.Directive.

func (*Rule) Validate

func (r *Rule) Validate(filePath string, line int,
	params map[string]string, columns map[string]gensection.ColumnConfig,
) []lint.Diagnostic

Validate implements gensection.Directive.

Jump to

Keyboard shortcuts

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