Documentation
¶
Overview ¶
Package engine discovers files, runs rules in parallel, applies inline suppression, and applies fixes or renders diffs.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ApplyEdits ¶
ApplyEdits returns src with every edit applied. Edits must not overlap; they are applied last-to-first so earlier offsets stay valid during splicing.
func Format ¶
Format applies the deterministic, idempotent whitespace pass: it collapses 3+ consecutive blank lines (outside fenced code) to one, ensures a single trailing newline, and applies the always-safe details-blank-line fix. Trailing-whitespace stripping is intentionally omitted (two trailing spaces are a markdown hard line break).
func UnifiedDiff ¶
UnifiedDiff renders a unified diff of before vs after for one file.
Types ¶
type Engine ¶
type Engine struct {
// contains filtered or unexported fields
}
Engine holds the resolved active rule set and config.
func New ¶
New resolves the active rules: built-ins filtered by enable/disable/default, plus compiled declarative rules from the config `custom:` block.
func (*Engine) Fix ¶
Fix lints, applies safe (and optionally unsafe) fixes per file, and either writes the files (dryRun=false) or returns them without writing. It returns the list of changed paths.
func (*Engine) MarkdownFiles ¶
MarkdownFiles returns the discovered markdown file paths under paths.
type Suppressor ¶
type Suppressor struct {
// contains filtered or unexported fields
}
Suppressor matches findings against inline doclint-disable directives and tracks which directives went unused.
func NewSuppressor ¶
func NewSuppressor(doc *document.Document) *Suppressor
NewSuppressor scans a document for suppression directives.
func (*Suppressor) Suppressed ¶
func (s *Suppressor) Suppressed(f rule.Finding) bool
Suppressed reports whether f is silenced, marking the matching directive used.
func (*Suppressor) Unused ¶
func (s *Suppressor) Unused() []rule.Finding
Unused returns findings describing directives that matched nothing.