src/lint/plan.bend checks
raw source on the hub · import bolt@1.66.0.0/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 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 each source once, and
reads the settings of each bolt.bend that grades a directory for setting
(C011). A run whose texts are past a budget parses its sources a batch at a
time, each batch dropped once its rules have run (final.run,
laws/LargeRunParsesInBatches.bend): the same findings, in less memory.
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.
14 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 ../role.bend as Role import ../rules.bend as Rules import ../rules/imports.bend as Imports import ../config.bend as Config import ../noqa.bend as Noqa import ../rules/style/noqa.bend as NoqaRule import ../rules/correctness/setting.bend as Setting import ../syntax/bind.bend as Bind import ../rules/digest.bend as Digest
Types
type Plan source · line 40 · raw
Data
what bolt prints, in order, and the status it exits with
Plan@lines:List<&2, String> -> @exit:U32 -> Plan
type Walk source · line 93 · raw
Data
a walk once it stops: the .bend files it found, and every directory it
read, the last one read first
Walk@found:List<&2, String> -> @read:List<&2, String> -> Walk
type Got source · line 396 · raw
Data
a source path and the text the World holds for it
Got@path:String -> @text:Maybe<&2, String> -> Got
type Conf source · line 436 · raw
Data
a directory and the config its findings are graded by
Conf@dir:String -> @config:0x243ea54885fbd6711eb0dc5731e3043f/src/config.Config -> Conf
type Kept source · line 784 · raw
Data
what a run keeps of one parsed source: its noqa marks, its findings from the per-file rules, and its digest for the project rules
Kept@marks:0x243ea54885fbd6711eb0dc5731e3043f/src/noqa.Marks -> @found:List<&2, 0x243ea54885fbd6711eb0dc5731e3043f/src/finding.Finding> -> @digest:0x243ea54885fbd6711eb0dc5731e3043f/src/rules/digest.Digest -> Kept
type Roles source · line 790 · raw
Data
the marks a source's role is read from, and the marks its digest's is: the first are the tree's when files are named, the second always the sources' own (Rules.project)
Roles@run:List<&2, 0x243ea54885fbd6711eb0dc5731e3043f/src/role.Mark> -> @own:List<&2, 0x243ea54885fbd6711eb0dc5731e3043f/src/role.Mark> -> Roles
type Run source · line 847 · raw
Data
what is kept of every source: its marks, findings and digest
Run@marks:List<&2, 0x243ea54885fbd6711eb0dc5731e3043f/src/noqa.Marks> -> @found:List<&2, 0x243ea54885fbd6711eb0dc5731e3043f/src/finding.Finding> -> @digests:List<&2, 0x243ea54885fbd6711eb0dc5731e3043f/src/rules/digest.Digest> -> Run
Definitions
def lines.of source · line 44 · raw
@pl:Plan -> List<&2, String>
the lines a plan prints
def exit.of source · line 49 · raw
@pl:Plan -> U32
the status a plan exits with
def walk.skipped source · line 61 · raw
@+name:String -> Bool
a directory the walk never descends into
def walk.bare source · line 65 · raw
@+name:String -> String
an entry's name without the "/" that marks it a directory
def walk.under source · line 69 · raw
@+dir:String -> @+name:String -> String
a name directly under a directory, as a path
def walk.dirs source · line 73 · raw
@es:List<&2, String> -> @+dir:String -> List<&2, String>
the sub-directories of a listing worth descending into, as paths
def walk.bends source · line 83 · raw
@es:List<&2, String> -> @+dir:String -> List<&2, String>
the .bend files of a listing, as paths (a directory's name ends in "/")
def walk.found source · line 97 · raw
@wk:Walk -> List<&2, String>
the files a walk found
def walk.read source · line 102 · raw
@wk:Walk -> List<&2, String>
the directories a walk read, in the order it read them
def walk source · line 110 · raw
@fuel:Nat -> @+world:0x243ea54885fbd6711eb0dc5731e3043f/src/lint/world.World -> @queue:List<&2, String> -> @acc:List<&2, String> -> @seen:List<&2, String> -> Walk
every .bend file under the directories still queued, the fuel bounding how
many directories are read, each read through the World's listing. What is
found is put in front of what came before, not after it, so the walk stays
linear; files sorts at the end regardless.
def limit source · line 134 · raw
Nat
how many directories the walk reads at most; past it the walk stops,
silently. A literal, not U32.to_nat(100000): the checker keeps a literal
whole and steps it one at a time, so laws/ScopeWalksWholeTree.bend's law can name the bound,
where it would expand the call in unary and overflow. The compiler emits
the same U32.to_nat for either.
def tree source · line 138 · raw
@+world:0x243ea54885fbd6711eb0dc5731e3043f/src/lint/world.World -> Walk
the walk of the tree under ., reading at most limit() directories
def files.named source · line 145 · raw
@paths:List<&2, String> -> @+world:0x243ea54885fbd6711eb0dc5731e3043f/src/lint/world.World -> List<&2, String>
the files named, or every .bend file the walk finds when none were
def files source · line 154 · raw
@+world:0x243ea54885fbd6711eb0dc5731e3043f/src/lint/world.World -> List<&2, String>
the files the lint runs over
def is_config source · line 158 · raw
@+p:String -> Bool
a bolt.bend is configuration, not source
def sources source · line 162 · raw
@ps:List<&2, String> -> List<&2, String>
the paths that are source
def inputs source · line 171 · raw
@+world:0x243ea54885fbd6711eb0dc5731e3043f/src/lint/world.World -> List<&2, String>
the source files of the run, in file-list order
def abs source · line 178 · raw
@+cwd:String -> @+path:String -> String
a path as the one file it names wherever it is spelled from: resolved
against the working directory when relative, then normalized
(src/rules/imports.bend), so a.bend, ./a.bend and /w/a.bend run
from /w are one
def norms source · line 182 · raw
@ps:List<&2, String> -> @+cwd:String -> List<&2, String>
each path resolved (abs)
def unseen source · line 190 · raw
@ps:List<&2, String> -> @+cwd:String -> @+seen:List<&2, String> -> List<&2, String>
the paths that resolve to none of the paths seen
def graph source · line 203 · raw
@+world:0x243ea54885fbd6711eb0dc5731e3043f/src/lint/world.World -> List<&2, String>
the files a run reads its roles from: every source the walk of the tree finds, then each source of the run the walk does not find (one named outside the working directory), so each file is read once. A file's role follows the imports, and the file that makes a named file code, a package's main.bend that imports it, may be named or not
def seen.has source · line 212 · raw
@ps:List<&2, String> -> @+pp:String -> Bool
whether a path is among the paths
def uniq.fast source · line 219 · raw
@ps:List<&2, String> -> @+ix:0x243ea54885fbd6711eb0dc5731e3043f/src/syntax/bind.Index -> List<&2, String>
def uniq source · line 233 · raw
@ps:List<&2, String> -> @+seen:List<&2, String> -> List<&2, String>
each path once, where it first appears: a path is kept when it is none of
those seen and none before it (laws/UniqKeepsFirstOccurrences.bend). The
paths met so far are held in the binder's index (src/syntax/bind.bend), each
put in as it is met: a scan of them for every path is the paths squared,
3 s a round of wants on a project of 4,062 files
def roots.of source · line 242 · raw
@ds:List<&2, String> -> @+world:0x243ea54885fbd6711eb0dc5731e3043f/src/lint/world.World -> List<&2, String>
the directories the walk read that hold a main.bend, . left out
def roots.named source · line 252 · raw
@paths:List<&2, String> -> @+world:0x243ea54885fbd6711eb0dc5731e3043f/src/lint/world.World -> List<&2, String>
the package roots but ., as the walk names them (./w3c)
def roots source · line 260 · raw
@+world:0x243ea54885fbd6711eb0dc5731e3043f/src/lint/world.World -> List<&2, String>
the package roots but .
def packages source · line 265 · raw
@rs:List<&2, String> -> List<&2, String>
each package root as the project rules take it: its directory as a digest
names one (w3c/)
def dirs.of source · line 273 · raw
@ps:List<&2, String> -> List<&2, String>
the directory of each path
def conf.dirs source · line 282 · raw
@+ps:List<&2, String> -> List<&2, String>
the directory of every source, each once: every finding's path is a source's, so these are the directories grading needs
def conf.chain source · line 288 · raw
@+world:0x243ea54885fbd6711eb0dc5731e3043f/src/lint/world.World -> @dir:String -> List<&2, String>
the bolt.bend candidates of a directory as a path names it, nearest first: the directory resolved against the working directory, then each parent up to the root
def conf.cands source · line 292 · raw
@ds:List<&2, String> -> @+world:0x243ea54885fbd6711eb0dc5731e3043f/src/lint/world.World -> List<&2, String>
the bolt.bend candidates of each directory, nearest first
def asks.entries source · line 300 · raw
@ds:List<&2, String> -> List<&2, 0x243ea54885fbd6711eb0dc5731e3043f/src/lint/world.Ask>
the listing of each directory, as a question
def asks.texts source · line 308 · raw
@ps:List<&2, String> -> List<&2, 0x243ea54885fbd6711eb0dc5731e3043f/src/lint/world.Ask>
the text of each path, as a question
def lists source · line 318 · raw
@+world:0x243ea54885fbd6711eb0dc5731e3043f/src/lint/world.World -> List<&2, 0x243ea54885fbd6711eb0dc5731e3043f/src/lint/world.Ask>
the listings the plan reads: every directory the walk of the tree reads, whether files were named or not, since a named file's role is read from the imports of the whole tree (graph)
def texts source · line 323 · raw
@+world:0x243ea54885fbd6711eb0dc5731e3043f/src/lint/world.World -> List<&2, 0x243ea54885fbd6711eb0dc5731e3043f/src/lint/world.Ask>
the texts the plan reads: each source, every file of the graph, and every bolt.bend candidate of the sources' directories, each once
def looks source · line 330 · raw
@+world:0x243ea54885fbd6711eb0dc5731e3043f/src/lint/world.World -> List<&2, 0x243ea54885fbd6711eb0dc5731e3043f/src/lint/world.Ask>
every question the plan reads the World through: the listings, then the texts
def unanswered.dirs source · line 333 · raw
@rs:List<&2, 0x243ea54885fbd6711eb0dc5731e3043f/src/lint/world.Reply> -> List<&2, String>
def unanswered.paths source · line 342 · raw
@rs:List<&2, 0x243ea54885fbd6711eb0dc5731e3043f/src/lint/world.Reply> -> List<&2, String>
def unanswered.hit source · line 351 · raw
@a:0x243ea54885fbd6711eb0dc5731e3043f/src/lint/world.Ask -> @+dx:0x243ea54885fbd6711eb0dc5731e3043f/src/syntax/bind.Index -> @+px:0x243ea54885fbd6711eb0dc5731e3043f/src/syntax/bind.Index -> Bool
def unanswered.fast source · line 358 · raw
@asks:List<&2, 0x243ea54885fbd6711eb0dc5731e3043f/src/lint/world.Ask> -> @+dx:0x243ea54885fbd6711eb0dc5731e3043f/src/syntax/bind.Index -> @+px:0x243ea54885fbd6711eb0dc5731e3043f/src/syntax/bind.Index -> List<&2, 0x243ea54885fbd6711eb0dc5731e3043f/src/lint/world.Ask>
def unanswered.of source · line 366 · raw
@asks:List<&2, 0x243ea54885fbd6711eb0dc5731e3043f/src/lint/world.Ask> -> @+rs:List<&2, 0x243ea54885fbd6711eb0dc5731e3043f/src/lint/world.Reply> -> List<&2, 0x243ea54885fbd6711eb0dc5731e3043f/src/lint/world.Ask>
def unanswered source · line 375 · raw
@asks:List<&2, 0x243ea54885fbd6711eb0dc5731e3043f/src/lint/world.Ask> -> @world:0x243ea54885fbd6711eb0dc5731e3043f/src/lint/world.World -> List<&2, 0x243ea54885fbd6711eb0dc5731e3043f/src/lint/world.Ask>
the questions a World does not answer yet, in order
(laws/UnansweredAreOpenQuestions.bend). The World answers a question when
some reply holds it, and a scan of the replies for every question is the
questions times the replies (1.8 s a round of wants on a project of 4,062
files). So the directories listed and the paths read are each put in the
binder's index (src/syntax/bind.bend) once, and each question asks its own
def wants.pick source · line 380 · raw
@ls:List<&2, 0x243ea54885fbd6711eb0dc5731e3043f/src/lint/world.Ask> -> @+world:0x243ea54885fbd6711eb0dc5731e3043f/src/lint/world.World -> List<&2, 0x243ea54885fbd6711eb0dc5731e3043f/src/lint/world.Ask>
the listings still open, or, once there are none, the texts still open
def wants source · line 389 · raw
@+world:0x243ea54885fbd6711eb0dc5731e3043f/src/lint/world.World -> List<&2, 0x243ea54885fbd6711eb0dc5731e3043f/src/lint/world.Ask>
the questions a World still leaves open. The file list is known only once every directory the walk reads is listed, so the texts wait for the walk.
def gots source · line 400 · raw
@ps:List<&2, String> -> @+world:0x243ea54885fbd6711eb0dc5731e3043f/src/lint/world.World -> List<&2, Got>
each source with what the World answers for it
def gots.ix source · line 408 · raw
@ps:List<&2, String> -> @+ix:0x243ea54885fbd6711eb0dc5731e3043f/src/lint/world.Ix -> List<&2, Got>
gots, each text read off the World's index
def unread source · line 416 · raw
@gs:List<&2, Got> -> List<&2, 0x243ea54885fbd6711eb0dc5731e3043f/src/finding.Finding>
one finding for each source that could not be read
def srcs_of source · line 426 · raw
@gs:List<&2, Got> -> List<&2, 0x243ea54885fbd6711eb0dc5731e3043f/src/src.Src>
every source that was read, parsed once for every rule
def texts.at source · line 440 · raw
@ps:List<&2, String> -> @+world:0x243ea54885fbd6711eb0dc5731e3043f/src/lint/world.World -> List<&2, Maybe<&2, String>>
what the World holds at each path
def texts.ix source · line 448 · raw
@ps:List<&2, String> -> @+ix:0x243ea54885fbd6711eb0dc5731e3043f/src/lint/world.Ix -> List<&2, Maybe<&2, String>>
texts.at, each read off the World's index
def conf.near source · line 457 · raw
@+world:0x243ea54885fbd6711eb0dc5731e3043f/src/lint/world.World -> @dir:String -> 0x243ea54885fbd6711eb0dc5731e3043f/src/config.Config
a directory's config: the nearest bolt.bend the World could read among its candidates, or the defaults
def conf.near.ix source · line 461 · raw
@+world:0x243ea54885fbd6711eb0dc5731e3043f/src/lint/world.World -> @+ix:0x243ea54885fbd6711eb0dc5731e3043f/src/lint/world.Ix -> @dir:String -> 0x243ea54885fbd6711eb0dc5731e3043f/src/config.Config
conf.near, its candidates read off the World's index
def confs.at source · line 465 · raw
@ds:List<&2, String> -> @+world:0x243ea54885fbd6711eb0dc5731e3043f/src/lint/world.World -> List<&2, Conf>
each directory's config
def confs.at.ix source · line 473 · raw
@ds:List<&2, String> -> @+world:0x243ea54885fbd6711eb0dc5731e3043f/src/lint/world.World -> @+ix:0x243ea54885fbd6711eb0dc5731e3043f/src/lint/world.Ix -> List<&2, Conf>
confs.at, each directory's candidates read off the World's index
def confs source · line 481 · raw
@+world:0x243ea54885fbd6711eb0dc5731e3043f/src/lint/world.World -> List<&2, Conf>
the config of every directory grading needs
def conf.find source · line 487 · raw
@cs:List<&2, Conf> -> @+world:0x243ea54885fbd6711eb0dc5731e3043f/src/lint/world.World -> @+dir:String -> 0x243ea54885fbd6711eb0dc5731e3043f/src/config.Config
the config of a directory, from the table; one the table does not hold is worked out the same way (every finding's directory is in the table, so this never happens in a run)
def config.at source · line 495 · raw
@+cs:List<&2, Conf> -> @+world:0x243ea54885fbd6711eb0dc5731e3043f/src/lint/world.World -> @path:String -> 0x243ea54885fbd6711eb0dc5731e3043f/src/config.Config
the config a finding at a path is graded by: its directory's
def per_file.role source · line 501 · raw
@+cs:List<&2, Conf> -> @+world:0x243ea54885fbd6711eb0dc5731e3043f/src/lint/world.World -> @+ms:List<&2, 0x243ea54885fbd6711eb0dc5731e3043f/src/role.Mark> -> @ss:List<&2, 0x243ea54885fbd6711eb0dc5731e3043f/src/src.Src> -> List<&2, 0x243ea54885fbd6711eb0dc5731e3043f/src/finding.Finding>
every source's findings from the per-file rules, each told its role among the marks (src/role.bend) and run at the limits its directory's config sets
def facts.of source · line 517 · raw
@gs:List<&2, Got> -> @+cwd:String -> List<&2, 0x243ea54885fbd6711eb0dc5731e3043f/src/role.Fact>
the facts (src/role.bend) of each file the World read, from its text, each at its path resolved against the working directory (abs)
def marks.key source · line 528 · raw
@ps:List<&2, String> -> @+cwd:String -> @+ms:List<&2, 0x243ea54885fbd6711eb0dc5731e3043f/src/role.Mark> -> List<&2, 0x243ea54885fbd6711eb0dc5731e3043f/src/role.Mark>
each path's mark as the path is spelled: its role among marks taken over resolved paths (abs), neither when it has none there
def marks.named source · line 538 · raw
@+world:0x243ea54885fbd6711eb0dc5731e3043f/src/lint/world.World -> List<&2, 0x243ea54885fbd6711eb0dc5731e3043f/src/role.Mark>
the marks of a run over files named on the line: every file of the graph read for its imports, the walk taken over their resolved paths, and each named file's role looked up there as it is named
def marks.run source · line 546 · raw
@paths:List<&2, String> -> @+world:0x243ea54885fbd6711eb0dc5731e3043f/src/lint/world.World -> @+s:List<&2, 0x243ea54885fbd6711eb0dc5731e3043f/src/src.Src> -> List<&2, 0x243ea54885fbd6711eb0dc5731e3043f/src/role.Mark>
the marks a run's roles are read from: over the whole tree, the sources' own; over files named on the line, the graph's, every file of the tree read for its imports, so the main.bend that imports a named file makes it code even when it is not named
def conf.first source · line 555 · raw
@gs:List<&2, Got> -> List<&2, String>
the path of the first candidate the World holds a text for, as a list of one; none when it holds none
def conf.used source · line 567 · raw
@ds:List<&2, String> -> @+world:0x243ea54885fbd6711eb0dc5731e3043f/src/lint/world.World -> List<&2, String>
the bolt.bend that grades each directory, in directory order: the first of its candidates the World read, as conf.near reads it; none for a directory graded by the defaults
def conf.used.ix source · line 575 · raw
@ds:List<&2, String> -> @+world:0x243ea54885fbd6711eb0dc5731e3043f/src/lint/world.World -> @+ix:0x243ea54885fbd6711eb0dc5731e3043f/src/lint/world.Ix -> List<&2, String>
conf.used, each candidate read off the World's index
def graders source · line 583 · raw
@+world:0x243ea54885fbd6711eb0dc5731e3043f/src/lint/world.World -> List<&2, String>
every bolt.bend grading reads, each once, in the order its directories come
def settings.at source · line 587 · raw
@gs:List<&2, Got> -> List<&2, 0x243ea54885fbd6711eb0dc5731e3043f/src/finding.Finding>
the setting rule's findings on each bolt.bend the World read, in order
def settings source · line 598 · raw
@+world:0x243ea54885fbd6711eb0dc5731e3043f/src/lint/world.World -> List<&2, 0x243ea54885fbd6711eb0dc5731e3043f/src/finding.Finding>
the setting rule's findings: each unknown setting of every bolt.bend
grading reads (src/rules/correctness/setting.bend)
def found.at source · line 605 · raw
@+cs:List<&2, Conf> -> @+world:0x243ea54885fbd6711eb0dc5731e3043f/src/lint/world.World -> @+gs:List<&2, Got> -> @+s:List<&2, 0x243ea54885fbd6711eb0dc5731e3043f/src/src.Src> -> List<&2, 0x243ea54885fbd6711eb0dc5731e3043f/src/finding.Finding>
every finding of every rule, ungraded, from the sources and what the World
answers for them: the read failures, the per-file findings of each source,
then setting's over each bolt.bend grading reads, then the project rules'
over every source and the other packages
def found source · line 615 · raw
@+world:0x243ea54885fbd6711eb0dc5731e3043f/src/lint/world.World -> List<&2, 0x243ea54885fbd6711eb0dc5731e3043f/src/finding.Finding>
every finding of every rule, ungraded
def grade source · line 624 · raw
@+cs:List<&2, Conf> -> @+world:0x243ea54885fbd6711eb0dc5731e3043f/src/lint/world.World -> @fs:List<&2, 0x243ea54885fbd6711eb0dc5731e3043f/src/finding.Finding> -> List<&2, 0x243ea54885fbd6711eb0dc5731e3043f/src/finding.Graded>
every finding graded by the config of its directory, in order, the ones at off dropped
def per_file.live source · line 634 · raw
@+cs:List<&2, Conf> -> @+world:0x243ea54885fbd6711eb0dc5731e3043f/src/lint/world.World -> @+ms:List<&2, 0x243ea54885fbd6711eb0dc5731e3043f/src/role.Mark> -> @ss:List<&2, 0x243ea54885fbd6711eb0dc5731e3043f/src/src.Src> -> List<&2, 0x243ea54885fbd6711eb0dc5731e3043f/src/finding.Finding>
every source's findings from the per-file rules its directory's config does not set off, each told its role among the marks
def found.live source · line 650 · raw
@+cs:List<&2, Conf> -> @+world:0x243ea54885fbd6711eb0dc5731e3043f/src/lint/world.World -> @+gs:List<&2, Got> -> @+s:List<&2, 0x243ea54885fbd6711eb0dc5731e3043f/src/src.Src> -> List<&2, 0x243ea54885fbd6711eb0dc5731e3043f/src/finding.Finding>
every finding of every rule that can be graded on, ungraded: found.at, a per-file rule its file's config sets off not run
def noqa source · line 664 · raw
@ms:List<&2, 0x243ea54885fbd6711eb0dc5731e3043f/src/noqa.Marks> -> @+whole:Bool -> @+gs:List<&2, 0x243ea54885fbd6711eb0dc5731e3043f/src/finding.Graded> -> List<&2, 0x243ea54885fbd6711eb0dc5731e3043f/src/finding.Finding>
the noqa rule's findings on each file's marks, against the graded
findings, each put at its file as a per-file rule's are
def after source · line 673 · raw
@+ms:List<&2, 0x243ea54885fbd6711eb0dc5731e3043f/src/noqa.Marks> -> @+whole:Bool -> @+gs:List<&2, 0x243ea54885fbd6711eb0dc5731e3043f/src/finding.Graded> -> @grader:(@_:List<&2, 0x243ea54885fbd6711eb0dc5731e3043f/src/finding.Finding> -> List<&2, 0x243ea54885fbd6711eb0dc5731e3043f/src/finding.Graded>) -> List<&2, 0x243ea54885fbd6711eb0dc5731e3043f/src/finding.Graded>
the graded findings no mark silences, in order, then the noqa rule's,
graded by the grader given: nothing silences what noqa reports
def final source · line 684 · raw
@+world:0x243ea54885fbd6711eb0dc5731e3043f/src/lint/world.World -> List<&2, 0x243ea54885fbd6711eb0dc5731e3043f/src/finding.Graded>
every finding of the run, graded, then silenced by the marks of the
sources, then noqa's own, which judges a project rule's code only when
the run is the whole tree. The sources are parsed once for both.
def final.live source · line 693 · raw
@+world:0x243ea54885fbd6711eb0dc5731e3043f/src/lint/world.World -> List<&2, 0x243ea54885fbd6711eb0dc5731e3043f/src/finding.Graded>
final, a per-file rule its file's config sets off not run: the same graded findings (laws/OffRulesAreNotRun.bend)
def budget source · line 718 · raw
U32
how many characters of text a run holds before it parses in batches, and how many a batch holds
def fits source · line 722 · raw
@world:0x243ea54885fbd6711eb0dc5731e3043f/src/lint/world.World -> Bool
whether the World's texts are within the budget
def got.size source · line 726 · raw
@g:Got -> U32
how many characters a source's text holds; none when it was not read
def batches.put source · line 735 · raw
@g:Got -> @bs:List<&2, List<&2, Got>> -> List<&2, List<&2, Got>>
a source put at the front of the first batch, or in a batch of its own when there is none
def batches.cut source · line 744 · raw
@full:Bool -> @g:Got -> @more:List<&2, List<&2, Got>> -> List<&2, List<&2, Got>>
a source before the batches after it: when the batch before it is full, that one ends here and the source opens the next
def batches source · line 754 · raw
@gs:List<&2, Got> -> @+used:U32 -> @+max:U32 -> List<&2, List<&2, Got>>
the sources cut into batches, in order: used is what the open batch holds
already, and a source that would take it past max opens the next, unless
the open batch holds nothing
def facts.texts source · line 765 · raw
@gs:List<&2, Got> -> List<&2, 0x243ea54885fbd6711eb0dc5731e3043f/src/role.Fact>
the fact (src/role.bend) of each source the World read, from its text alone: what Role.fact reads off its parse
def marks.pick source · line 775 · raw
@paths:List<&2, String> -> @+world:0x243ea54885fbd6711eb0dc5731e3043f/src/lint/world.World -> @own:List<&2, 0x243ea54885fbd6711eb0dc5731e3043f/src/role.Mark> -> List<&2, 0x243ea54885fbd6711eb0dc5731e3043f/src/role.Mark>
the marks a run's roles are read from (marks.run), given the sources' own
def kept.of source · line 794 · raw
@+cs:List<&2, Conf> -> @+world:0x243ea54885fbd6711eb0dc5731e3043f/src/lint/world.World -> @rs:Roles -> @s:0x243ea54885fbd6711eb0dc5731e3043f/src/src.Src -> Kept
one parsed source read down to what the run keeps of it
def keeps.srcs source · line 802 · raw
@+cs:List<&2, Conf> -> @+world:0x243ea54885fbd6711eb0dc5731e3043f/src/lint/world.World -> @+rs:Roles -> @ss:List<&2, 0x243ea54885fbd6711eb0dc5731e3043f/src/src.Src> -> List<&2, Kept>
each parsed source read down to what the run keeps, in order
def keeps.batches source · line 810 · raw
@+cs:List<&2, Conf> -> @+world:0x243ea54885fbd6711eb0dc5731e3043f/src/lint/world.World -> @+rs:Roles -> @bs:List<&2, List<&2, Got>> -> List<&2, Kept>
each batch parsed, read down to what the run keeps and dropped, in order
def keeps.marks source · line 823 · raw
@ks:List<&2, Kept> -> List<&2, 0x243ea54885fbd6711eb0dc5731e3043f/src/noqa.Marks>
each source's noqa marks, in order
def keeps.found source · line 831 · raw
@ks:List<&2, Kept> -> List<&2, 0x243ea54885fbd6711eb0dc5731e3043f/src/finding.Finding>
every source's per-file findings, in order
def keeps.digests source · line 839 · raw
@ks:List<&2, Kept> -> List<&2, 0x243ea54885fbd6711eb0dc5731e3043f/src/rules/digest.Digest>
each source's digest, in order
def keeps.run source · line 851 · raw
@+ks:List<&2, Kept> -> Run
what is kept of each source, as the three lists a run reads
def final.of source · line 857 · raw
@+world:0x243ea54885fbd6711eb0dc5731e3043f/src/lint/world.World -> @+cs:List<&2, Conf> -> @gs:List<&2, Got> -> @r:Run -> List<&2, 0x243ea54885fbd6711eb0dc5731e3043f/src/finding.Graded>
a run's graded findings from what it kept of its sources: the read
failures, the per-file findings, setting's, then the project rules' over
the digests, graded, silenced, and noqa's own (final.live)
def final.lean source · line 867 · raw
@+world:0x243ea54885fbd6711eb0dc5731e3043f/src/lint/world.World -> List<&2, 0x243ea54885fbd6711eb0dc5731e3043f/src/finding.Graded>
final.live with the sources parsed a batch at a time: every source's role read first, from its text, then each batch parsed, read down to what the run keeps and dropped. The same graded findings (laws/LargeRunParsesInBatches.bend)
def final.run source · line 876 · raw
@+world:0x243ea54885fbd6711eb0dc5731e3043f/src/lint/world.World -> List<&2, 0x243ea54885fbd6711eb0dc5731e3043f/src/finding.Graded>
the graded findings of the run bolt makes: every source parsed first when the World's texts fit the budget, a batch at a time when they do not
def errors.at source · line 883 · raw
@l:0x243ea54885fbd6711eb0dc5731e3043f/src/config.Level -> @more:U32 -> U32
one more at error, or the count as it was
def errors source · line 893 · raw
@gs:List<&2, 0x243ea54885fbd6711eb0dc5731e3043f/src/finding.Graded> -> U32
how many are errors
def warnings.at source · line 901 · raw
@l:0x243ea54885fbd6711eb0dc5731e3043f/src/config.Level -> @more:U32 -> U32
one more below error, or the count as it was
def warnings source · line 911 · raw
@gs:List<&2, 0x243ea54885fbd6711eb0dc5731e3043f/src/finding.Graded> -> U32
how many are not errors
def has_error source · line 919 · raw
@gs:List<&2, 0x243ea54885fbd6711eb0dc5731e3043f/src/finding.Graded> -> Bool
whether any is an error
def count source · line 928 · raw
@+n:U32 -> @+what:String -> String
1 error, 2 errors
def summary source · line 932 · raw
@+gs:List<&2, 0x243ea54885fbd6711eb0dc5731e3043f/src/finding.Graded> -> String
clean, or the counts
def show_all source · line 937 · raw
@gs:List<&2, 0x243ea54885fbd6711eb0dc5731e3043f/src/finding.Graded> -> List<&2, String>
every graded finding as a line
def plan source · line 946 · raw
@+world:0x243ea54885fbd6711eb0dc5731e3043f/src/lint/world.World -> Plan
bolt over a World: every graded finding no mark silences as a line, then
noqa's, then the summary of those, and exit 1 exactly when one is an error