src/rules/correctness/hole.bend checks
raw source on the hub · import bolt@1.48.0.0/src/rules/correctness/hole.bend as Hole
rule hole: a TODO hole left in code, the one bend counts when it prints
SOME PROOFS FAIL then "Error: 1 TODO found." or "Error: N TODOs found."
and exits 1 (bend 2.0.34): a ? and then the name TODO, with any spaces, newlines or comments
between them (?TODO, ? TODO). ?todo, ?TODO_later and ?TODO.x are
other names, which bend reports as a type error, not as a TODO, and they are
not reported here. The finding spans ? through TODO when both sit on one
line, and the ? alone when TODO is on a later line. LAWS.bend is exempt:
by convention its laws are open claims, filled by PROOF.bend beside it.
8 imports
import Base import ../../paths.bend as Paths import ../../role.bend as Role import ../../src.bend as Src import ../../finding.bend as F import ../../syntax/lex.bend as Lex import ../../lazy/lazy.bend as Lazy import ../calls.bend as Calls
Definitions
def check.todo source · line 19 · raw
@toks:List<&2, 0x6bb0891959f774bd94f33b9c30f054d3/src/syntax/lex.Tok> -> Bool
True when the first token past spaces, newlines and comments is TODO
def check.width source · line 28 · raw
@toks:List<&2, 0x6bb0891959f774bd94f33b9c30f054d3/src/syntax/lex.Tok> -> @+line:U32 -> @+col:U32 -> U32
the width of the hole a ? at line, col starts: through the next token
past spaces, newlines and comments when it sits on the same line, else 1
def check.go source · line 36 · raw
@toks:List<&2, 0x6bb0891959f774bd94f33b9c30f054d3/src/syntax/lex.Tok> -> @+path:String -> List<&2, 0x6bb0891959f774bd94f33b9c30f054d3/src/finding.Finding>
def check.on source · line 46 · raw
@toks:List<&2, 0x6bb0891959f774bd94f33b9c30f054d3/src/syntax/lex.Tok> -> @+path:String -> List<&2, 0x6bb0891959f774bd94f33b9c30f054d3/src/finding.Finding>
def check.role source · line 50 · raw
@rr:0x6bb0891959f774bd94f33b9c30f054d3/src/role.Role -> @ss:0x6bb0891959f774bd94f33b9c30f054d3/src/src.Src -> List<&2, 0x6bb0891959f774bd94f33b9c30f054d3/src/finding.Finding>
the rule, told the file's role (src/role.bend): a law file is skipped
def check source · line 55 · raw
@ss:0x6bb0891959f774bd94f33b9c30f054d3/src/src.Src -> List<&2, 0x6bb0891959f774bd94f33b9c30f054d3/src/finding.Finding>
the rule