Versions in this module Expand all Collapse all v3 v3.20.0 Sep 2, 2026 Changes in this version + var ActionDir = filepath.Join(ConfigDir, "actions") + var AlertLevels = []string + var CommentsByNormedExt = map[string]map[string]string + var ConfigDir = "config" + var ConfigDirs = []string + var ConfigVars = map[string]string + var DictDir = filepath.Join(ConfigDir, "dictionaries") + var FilterDir = filepath.Join(ConfigDir, "filters") + var FormatByExtension = map[string][]string + var IgnoreDir = filepath.Join(ConfigDir, "ignore") + var LevelToInt = map[string]int + var PipeDir = ".vale-config" + var ScriptDir = filepath.Join(ConfigDir, "scripts") + var TestFileSuffixes = []string + var TmplDir = filepath.Join(ConfigDir, "templates") + var ViewDir = filepath.Join(ConfigDir, "views") + var VocabDir = filepath.Join(ConfigDir, "vocabularies") + func AllStringsInSlice(strings []string, slice []string) bool + func CapFirst(s string) string + func CheckName(styleRoot, rulePath string) (string, error) + func CondSprintf(format string, v ...interface{}) string + func DefaultConfig() (string, error) + func DefaultStylesPath() (string, error) + func FindAsset(cfg *Config, path string) string + func FindConfigAsset(cfg *Config, name, dir string) string + func FormatAlert(a *Alert, limit int, level, name string) + func FormatFromExt(path string, mapping map[string]string) (string, string) + func FormatMessage(msg string, subs ...string) string + func FromFile(cfg *Config, dry bool) (*ini.File, error) + func FromString(src string, cfg *Config, dry bool) (*ini.File, error) + func GetNormedExt(ext string) string + func GetPackages(src string) ([]string, error) + func HasAnySuffix(s string, suffixes []string) bool + func IgnoreFiles(stylesPath string) ([]string, error) + func InRange(n int, r []int) bool + func Indent(text, indent string) string + func IntInSlice(a int, slice []int) bool + func IsCode(s string) bool + func IsLetter(s string) bool + func IsPhrase(s string) bool + func IsTestFile(name string) bool + func MockLoad(project, local string, cfg *Config) error + func NewE100(context string, err error) error + func NewE201(msg, value, path string, finder errorCondition) error + func NewE201FromPosition(msg, file string, goal int) error + func NewE201FromTarget(msg, value, file string) error + func NewError(code, title, msg string) error + func ReplaceAllStringSubmatchFunc(re *regexp.Regexp, str string, repl func([]string) string) string + func Sanitize(txt string) string + func ShouldIgnoreDirectory(directoryPath string) bool + func SplitLines(data []byte, atEOF bool) (adv int, token []byte, err error) + func StringInSlice(a string, slice []string) bool + func StringsToInterface(strings []string) []interface + func StripANSI(s string) string + func StyleName(rule string) string + func Substitute(src, sub string, char rune) (string, bool) + func TextToContext(text string, meta *nlp.Info) []nlp.TaggedWord + func ToSentence(words []string, andOrOr string) string + func UniqueStrings(slice []string) []string + func Warn(msg string) + func WhitespaceToSpace(msg string) string + type Action struct + Name string + Params []string + type Alert struct + Action Action + Check string + Description string + HasByteOffsets bool + Hide bool + Limit int + Line int + Link string + Match string + Message string + Offset []string + Severity string + Span []int + type ByName []*File + func (a ByName) Len() int + func (a ByName) Less(i, j int) bool + func (a ByName) Swap(i, j int) + type ByPosition []Alert + func (a ByPosition) Len() int + func (a ByPosition) Less(i, j int) bool + func (a ByPosition) Swap(i, j int) + type CLIFlags struct + AlertLevel string + Apply bool + Built string + Counts bool + Filter string + Glob string + Help bool + IgnoreGlobal bool + InExt string + InPath string + Local bool + NoColor bool + NoExit bool + Normalize bool + Output string + Path string + PlainProgress bool + Relative bool + Remote bool + Simple bool + Sorted bool + Sources string + Version bool + Wrap bool + type Config struct + AcceptedTokens []string + Asciidoctor map[string]string + BlockIgnores map[string][]string + Checks []string + CommentDelimiters map[string][2]string + ConfigFiles []string + FallbackPath string + Flags *CLIFlags + FormatToLang map[string]string + Formats map[string]string + GBaseStyles []string + GChecks map[string]bool + IgnoredClasses []string + IgnoredScopes []string + MinAlertLevel int + NLPEndpoint string + Paths []string + RejectedTokens []string + RootINI string + RuleKeys []string + RuleToLevel map[string]string + RuleToParams map[string]map[string]string + SBaseStyles map[string][]string + SChecks map[string]map[string]bool + SLevels map[string]map[string]string + SecToPat map[string]glob.Glob + SkippedScopes []string + StyleKeys []string + Styles []string + Stylesheets map[string]string + TokenIgnores map[string][]string + Views map[string]*View + Vocab []string + WordTemplate string + func NewConfig(flags *CLIFlags) (*Config, error) + func ReadPipeline(flags *CLIFlags, dry bool) (*Config, error) + func (c *Config) AddConfigFile(name string) + func (c *Config) AddStylesPath(path string) + func (c *Config) AddWordListFile(name string, accept bool) error + func (c *Config) ConfigFile() string + func (c *Config) Root() (string, error) + func (c *Config) SearchPaths() []string + func (c *Config) String() string + func (c *Config) StylesPath() string + type ConfigSrc int + const FileSrc + const StringSrc + type DaselValue = any + type File struct + Alerts []Alert + BaseStyles []string + Checks map[string]bool + ChkToCtx map[string]string + Comments map[string]bool + Content string + Format string + Levels map[string]string + Lines []string + Lookup bool + MetaScope string + Metrics map[string]int + NLP nlp.Info + NormedExt string + NormedPath string + Path string + RealExt string + Sequences []string + Summary bytes.Buffer + Transform string + func NewFile(src string, config *Config) (*File, error) + func (f *File) AddAlert(a Alert, blk nlp.Block, lines, pad int, lookup bool) + func (f *File) ComputeMetrics() (map[string]interface{}, error) + func (f *File) FindLoc(ctx, s string, pad, count int, a Alert, at int) (int, []int) + func (f *File) Level(name, compiled string) string + func (f *File) MapAlertsToSource() + func (f *File) QueryComments(check string) bool + func (f *File) RegionDisabled(check, match string, line, col int) bool + func (f *File) ResetComments() + func (f *File) SetMetaScope(scope string) + func (f *File) SetNormedExt(ext string) + func (f *File) SetText(s string) + func (f *File) SortedAlerts() []Alert + func (f *File) StartBlock() + func (f *File) Tokens(text string) []tag.Token + func (f *File) TokensWith(model, text string) ([]tag.Token, error) + func (f *File) UpdateComments(comment string) + func (f *File) UpdateCommentsAt(comment string, off int) + type Scope struct + Expr string + Name string + Type string + type ScopedValue struct + Column int + Line int + Text string + type ScopedValues struct + Format string + Scope string + Values []ScopedValue + type View struct + Engine string + Scopes []Scope + func NewView(path string) (*View, error) + func (b *View) Apply(f *File) ([]ScopedValues, error)