MCPcopy Create free account
hub / github.com/vale-cli/vale / lintScope

Method lintScope

internal/lint/ast.go:148–171  ·  view source on GitHub ↗
(f *core.File, state *walker, txt string)

Source from the content-addressed store, hash-verified

146}
147
148func (l *Linter) lintScope(f *core.File, state *walker, txt string) error {
149 for _, tag := range state.tagHistory {
150 scope, match := tagToScope[tag]
151 if (match && !core.StringInSlice(tag, inlineTags)) || heading.MatchString(tag) {
152 if scope == "text.blockquote" || scope == "text.list" {
153 f.Summary.WriteString(txt + "\n\n")
154 }
155
156 if !match {
157 scope = "text.heading." + tag
158 }
159 f.Metrics[strings.TrimPrefix(scope, "text.")]++
160
161 txt = strings.TrimLeft(txt, " ")
162 b := state.block(txt, scope+l.metaScope+f.RealExt)
163 return l.lintBlock(f, b, state.lines, 0, false)
164 }
165 }
166
167 f.Summary.WriteString(txt + "\n\n")
168
169 b := state.block(txt, "text"+l.metaScope+f.RealExt)
170 return l.lintProse(f, b, state.lines)
171}
172
173func (l *Linter) lintSizedScopes(f *core.File) error {
174 f.ResetComments()

Callers 1

lintHTMLTokensMethod · 0.95

Calls 4

lintBlockMethod · 0.95
lintProseMethod · 0.95
StringInSliceFunction · 0.92
blockMethod · 0.80

Tested by

no test coverage detected