Versions in this module Expand all Collapse all v3 v3.20.0 Sep 2, 2026 Changes in this version + func FixAlert(alert core.Alert, cfg *core.Config) ([]string, error) + type Capitalization struct + Check func(s string, re *rx.Regexp) (string, bool) + Exceptions []string + Indicators []string + Match string + Prefix string + Style string + Threshold float64 + Vocab bool + func NewCapitalization(cfg *core.Config, generic baseCheck, path string) (Capitalization, error) + func (c Capitalization) Fields() Definition + func (c Capitalization) Pattern() string + func (c Capitalization) Run(blk nlp.Block, _ *core.File, cfg *core.Config) ([]core.Alert, error) + type Conditional struct + Exceptions []string + First string + Ignorecase bool + Second string + Vocab bool + func NewConditional(cfg *core.Config, generic baseCheck, path string) (Conditional, error) + func (c Conditional) Fields() Definition + func (c Conditional) Pattern() string + func (c Conditional) Run(blk nlp.Block, f *core.File, cfg *core.Config) ([]core.Alert, error) + type Consistency struct + Either map[string]string + Ignorecase bool + Nonword bool + func NewConsistency(cfg *core.Config, generic baseCheck, path string) (Consistency, error) + func (o Consistency) Fields() Definition + func (o Consistency) Pattern() string + func (o Consistency) Run(blk nlp.Block, f *core.File, cfg *core.Config) ([]core.Alert, error) + type Definition struct + Action core.Action + Description string + Extends string + Level string + Limit int + Link string + MatchCase bool + Message string + Name string + Scope []string + Selector Selector + type Existence struct + Append bool + Exceptions []string + IgnoreCase bool + Nonword bool + Raw []string + Tokens []string + Vocab bool + func NewExistence(cfg *core.Config, generic baseCheck, path string) (Existence, error) + func (e Existence) Fields() Definition + func (e Existence) Pattern() string + func (e Existence) Run(blk nlp.Block, _ *core.File, cfg *core.Config) ([]core.Alert, error) + type FilterEnv struct + Rules []Definition + type Manager struct + Config *core.Config + func NewManager(config *core.Config) (*Manager, error) + func (mgr *Manager) AddRule(name string, rule Rule) error + func (mgr *Manager) AddRuleFromFile(name, path string) error + func (mgr *Manager) AssignNLP(f *core.File) nlp.Info + func (mgr *Manager) HasScope(scope string) bool + func (mgr *Manager) NeedsTagging() bool + func (mgr *Manager) RuleForAlert(name string) string + func (mgr *Manager) Rules() map[string]Rule + type Metric struct + Condition string + Formula string + func NewMetric(_ *core.Config, generic baseCheck, path string) (Metric, error) + func (o Metric) Fields() Definition + func (o Metric) Pattern() string + func (o Metric) Run(_ nlp.Block, f *core.File, _ *core.Config) ([]core.Alert, error) + type NLPToken struct + Min int + Negate bool + Pattern string + Skip int + Tag string + Target bool + UPOS string + type Occurrence struct + Ignorecase bool + Max int + Min int + Token string + func NewOccurrence(_ *core.Config, generic baseCheck, path string) (Occurrence, error) + func (o Occurrence) Fields() Definition + func (o Occurrence) Pattern() string + func (o Occurrence) Run(blk nlp.Block, _ *core.File, cfg *core.Config) ([]core.Alert, error) + type Readability struct + Grade float64 + Metrics []string + func NewReadability(_ *core.Config, generic baseCheck, path string) (Readability, error) + func (o Readability) Fields() Definition + func (o Readability) Pattern() string + func (o Readability) Run(blk nlp.Block, _ *core.File, _ *core.Config) ([]core.Alert, error) + type Repetition struct + Alpha bool + Exceptions []string + Ignorecase bool + Max int + Tokens []string + Vocab bool + func NewRepetition(cfg *core.Config, generic baseCheck, path string) (Repetition, error) + func (o Repetition) Fields() Definition + func (o Repetition) Pattern() string + func (o Repetition) Run(blk nlp.Block, _ *core.File, cfg *core.Config) ([]core.Alert, error) + type Rule interface + Fields func() Definition + Pattern func() string + Run func(blk nlp.Block, file *core.File, cfg *core.Config) ([]core.Alert, error) + type Scope struct + Selectors map[string][]Selector + func NewScope(value []string) Scope + func (s Scope) Matches(blk nlp.Block) bool + type Script struct + Script string + func NewScript(cfg *core.Config, generic baseCheck, path string) (Script, error) + func (s Script) Fields() Definition + func (s Script) Pattern() string + func (s Script) Run(blk nlp.Block, _ *core.File, _ *core.Config) ([]core.Alert, error) + type Selector struct + Negated bool + Value []string + func NewSelector(value []string) Selector + func (s *Selector) Contains(sel Selector) bool + func (s *Selector) ContainsString(scope []string) bool + func (s *Selector) Equal(sel Selector) bool + func (s *Selector) Has(scope string) bool + func (s *Selector) Sections() []string + type Sequence struct + Exceptions []string + Ignorecase bool + Model string + Tokens []NLPToken + func NewSequence(cfg *core.Config, generic baseCheck, path string) (Sequence, error) + func (s Sequence) Fields() Definition + func (s Sequence) Pattern() string + func (s Sequence) Run(blk nlp.Block, f *core.File, _ *core.Config) ([]core.Alert, error) + type Solution struct + Error string + Suggestions []string + func ParseAlert(s string, cfg *core.Config) (Solution, error) + type Spelling struct + Aff string + Append bool + Custom bool + Dic string + Dicpath string + Dictionaries []string + Exceptions []string + Filters []*regexp.Regexp + Ignore []string + Threshold int + func NewSpelling(cfg *core.Config, generic baseCheck, path string) (Spelling, error) + func (s Spelling) Fields() Definition + func (s Spelling) Pattern() string + func (s Spelling) Run(blk nlp.Block, _ *core.File, _ *core.Config) ([]core.Alert, error) + func (s Spelling) Suggest(word string) []string + type Substitution struct + Capitalize bool + Exceptions []string + Ignorecase bool + Nonword bool + POS string + Swap map[string]string + Vocab bool + func NewSubstitution(cfg *core.Config, generic baseCheck, path string) (Substitution, error) + func (s Substitution) Fields() Definition + func (s Substitution) Pattern() string + func (s Substitution) Run(blk nlp.Block, _ *core.File, cfg *core.Config) ([]core.Alert, error)