Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var AllChecks = map[string]check{}
AllChecks holds all of our individual checks. The keys are in the form "styleName.checkName".
Functions ¶
This section is empty.
Types ¶
type Alert ¶
type Alert struct {
Check string // the name of the check
Description string // why `Message` is meaningful
Line int // the source line
Link string // reference material
Message string // the output message
Severity string // 'suggestion', 'warning', or 'error'
Span []int // the [begin, end] location within a line
}
An Alert represents a potential error in prose.
type Block ¶
type Block struct {
Context string // parent content (if any) - e.g., paragraph -> sentence
Text string // text content
Scope Selector // section selector
}
A Block represents a section of text.
type ByPosition ¶
type ByPosition []Alert
ByPosition sorts Alerts by line and column.
func (ByPosition) Len ¶
func (a ByPosition) Len() int
func (ByPosition) Less ¶
func (a ByPosition) Less(i, j int) bool
func (ByPosition) Swap ¶
func (a ByPosition) Swap(i, j int)
type File ¶
type File struct {
Alerts []Alert // all alerts associated with this file
BaseStyles []string // base style assigned in .vale
Checks map[string]bool // syntax-specific checks assigned in .txtint
Counts map[string]int // word counts
Format string // 'code', 'markup' or 'prose'
NormedExt string // the normalized extension (see util/format.go)
Path string // the full path
RealExt string // actual file extension
Scanner *bufio.Scanner // used by lintXXX functions
Sequences []string // tracks various info (e.g., defined abbreviations)
}
A File represents a linted text file.
func (*File) SortedAlerts ¶
SortedAlerts returns all of f's alerts sorted by line and column.
Click to show internal directories.
Click to hide internal directories.