def pub.lint
bolt@1.27.0.0 · src/lsp/server.bend:232
import bolt@1.27.0.0/src/lsp/server.bend as Server
import Base
import bolt@1.27.0.0/src/rules.bend as Lint
import bolt@1.27.0.0/src/finding.bend as Finding
import bolt@1.27.0.0/src/config.bend as Config
import bolt@1.27.0.0/src/lint/plan.bend as Plan
import bolt@1.27.0.0/src/role.bend as Role
import bolt@1.27.0.0/src/src.bend as Src
import bolt@1.27.0.0/src/noqa.bend as Noqa
import bolt@1.27.0.0/src/syntax/lex.bend as Lex
232
233
234
235
236
237
238def pub.lint(
239 +path: String,
240 +text: String,
241 rs: List<&2, Maybe<&2, String>>,
242 ms: List<&2, Role.Mark>
243) -> List<&2, Finding.Graded>:
244 +cfg = Config.nearest(rs)
245 Bool.pick(List<&2, Finding.Graded>, Plan.is_config(path), [],
246 Plan.after([Noqa.file(path, Lex.tokens(text))], False{},
247 Lint.graded(cfg, Lint.on.role(Role.of(ms, path), Src.of(path, text))), fs => Lint.graded(cfg, fs)))