tableformat

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormatString

func FormatString(s string, pad int) string

FormatString formats all markdown tables in s with the given padding and returns the result. This is used by other rules (e.g. MDS019) that generate table content and need it to comply with MDS025.

Types

type Rule

type Rule struct {
	Pad int // spaces on each side of cell content
}

Rule checks that markdown tables are formatted with consistent column widths and padding (prettier-style).

func (*Rule) ApplySettings

func (r *Rule) ApplySettings(settings 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

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) GetPad

func (r *Rule) GetPad() int

GetPad returns the current pad setting.

func (*Rule) ID

func (r *Rule) ID() string

ID implements rule.Rule.

func (*Rule) Name

func (r *Rule) Name() string

Name implements rule.Rule.

Jump to

Keyboard shortcuts

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