Documentation
¶
Overview ¶
Package lint implements Vale's syntax-aware linting functionality.
The package is split into core linting logic (this file), source code (code.go), and markup (markup.go).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DocumentErrors ¶ added in v3.25.0
type DocumentErrors []error
DocumentErrors are the documents a run couldn't lint, each with its own error. Every other document was linted.
func (DocumentErrors) Error ¶ added in v3.25.0
func (e DocumentErrors) Error() string
type ExtendedHTMLWriter ¶
type ExtendedHTMLWriter struct {
*org.HTMLWriter
}
func (*ExtendedHTMLWriter) WriteComment ¶
func (w *ExtendedHTMLWriter) WriteComment(n org.Comment)
func (*ExtendedHTMLWriter) WriteFootnoteDefinition ¶ added in v3.23.0
func (w *ExtendedHTMLWriter) WriteFootnoteDefinition(f org.FootnoteDefinition)
WriteFootnoteDefinition writes a footnote's body where the source has it. go-org collects the definitions and writes them at the end of the document, and an alert in one was then reported wherever the text next happened to match.
func (*ExtendedHTMLWriter) WriteFootnoteLink ¶ added in v3.23.0
func (w *ExtendedHTMLWriter) WriteFootnoteLink(l org.FootnoteLink)
WriteFootnoteLink writes an inline footnote's text and nothing for a reference: the number go-org writes is not in the source.
func (*ExtendedHTMLWriter) WriteKeyword ¶ added in v3.23.0
func (w *ExtendedHTMLWriter) WriteKeyword(k org.Keyword)
WriteKeyword writes a prose keyword where it is: the title as a heading, the author or description as a paragraph. go-org writes the title at the top of the document instead, which is not where the source has it, so that is switched off in lintOrg.
type Linter ¶
type Linter struct {
Manager *check.Manager
// BlockHook, when set, receives every block before its rules run.
BlockHook func(nlp.Block)
// RuleHook, when set, receives each rule's name and what its Run cost.
// A hooked run takes the serial path, which is the one that can time a rule.
RuleHook func(name string, took time.Duration)
// contains filtered or unexported fields
}
A Linter lints a File.
func (*Linter) LintString ¶
LintString src according to its format.