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# the linter's findings on the text the editor shows, each rule told the
233# file's role among the marks, at the levels the nearest bolt.bend read gives
234# them, less what the text's noqa comments
235# silence, then the `noqa` rule's, which judges no project rule's code (the
236# editor runs none); none for a bolt.bend, which is bolt's configuration,
237# not source
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)))

Uses (16)

Used by (2)