~/bend-docscommunity

src/lint/plan.bend fails

raw source on the hub · import 0xde9bb08f7de298b03207fb5797ede9a5/src/lint/plan.bend as Plan

src/lint/plan: bolt (the lint) as a pure planner. It reads a World (src/lint/world.bend) and returns either the questions it still needs answered (wants) or the Plan: the lines to print and the exit status (plan). The interpreter (src/lint.bend) loops on wants, answering each question by IO, until nothing is wanted, then prints plan's lines and exits with its status. The design is docs/rfc/bolt-lint-planner.md.

With no files named, the planner walks the tree under . as a fold over the World's listings: a directory not listed yet reads as empty and is asked for, so each round of the loop lists one more level of the tree. Once every directory the walk reads is listed, it asks for the text of each source, of SPEC.md, and of every bolt.bend candidate of their directories, each once. A directory's candidates are taken once it is resolved against the World's working directory (Config.home), so a relative path is graded by the same bolt.bend wherever bolt runs from. wants never parses a file; plan parses and lints once. Once every rule has run and each finding is graded, the noqa comments (src/noqa.bend) silence what they name, and then the noqa rule reports the comments that silenced nothing.

9 imports
import Base
import ../lazy/lazy.bend as Lazy
import ./world.bend as W
import ../finding.bend as F
import ../src.bend as Src
import ../rules.bend as Rules
import ../config.bend as Config
import ../noqa.bend as Noqa
import ../rules/style/noqa.bend as NoqaRule