Documentation
¶
Overview ¶
Package consider provides the core of a linter that helps to avoid certain phrases in code.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Formatting ¶
type Formatting struct {
// WithReferences indicates whether the long-form of references shall be added.
// This is not done by default as this is done in separate lines.
WithReferences *bool `yaml:"withReferences"`
}
Formatting descries how messages shall be formatted.
type Linter ¶
type Linter struct {
// contains filtered or unexported fields
}
Linter is the main type of the linting functionality.
type Phrase ¶
type Phrase struct {
// Synonyms are one or more expressions that have the same meaning and proposed alternatives.
Synonyms []string `yaml:"synonyms"`
// Alternatives are zero, one, or more expressions that are provided as replacement.
Alternatives []string `yaml:"alternatives"`
// References is a list of either direct, or keyed references into the global map of references.
References []string `yaml:"references"`
}
Phrase describes an expression, with optional alternatives, that the linter flags.
type Reporter ¶
type Reporter interface {
// Report is called for each detected issue.
Report(pos token.Pos, message string)
}
Reporter is the outgoing interface for detected issues.
type Settings ¶
type Settings struct {
// References is a key-value map of short keys to a reference, typically a stable link.
// They indicate resources that can help understand why phrases are flagged, or
// at least give examples of other (larger) peer groups that considered rewording.
References map[string]string `yaml:"references"`
// Phrases describe all the texts the linter should look for.
Phrases []Phrase `yaml:"phrases"`
// Formatting describes how the messages shall be formatted.
Formatting Formatting `yaml:"formatting"`
}
Settings contain all the parameters for the analysis.
Click to show internal directories.
Click to hide internal directories.