~/bend-docscommunity

src/rules/correctness/hole.bend checks

raw source on the hub · import 0x013e0f9a479bbebad5ed196725eede95/src/rules/correctness/hole.bend as Hole

rule hole: a TODO hole left in code, the one bend counts in "N TODO found": 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.

7 imports
import Base
import ../../paths.bend as Paths
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 17 · raw

@toks:List<&2, 0x013e0f9a479bbebad5ed196725eede95/src/syntax/lex.Tok> -> Bool

True when the first token past spaces, newlines and comments is TODO

def check.width source · line 26 · raw

@toks:List<&2, 0x013e0f9a479bbebad5ed196725eede95/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 34 · raw

@toks:List<&2, 0x013e0f9a479bbebad5ed196725eede95/src/syntax/lex.Tok> -> @+path:String -> List<&2, 0x013e0f9a479bbebad5ed196725eede95/src/finding.Finding>

def check.on source · line 44 · raw

@toks:List<&2, 0x013e0f9a479bbebad5ed196725eede95/src/syntax/lex.Tok> -> @+path:String -> List<&2, 0x013e0f9a479bbebad5ed196725eede95/src/finding.Finding>

def check source · line 48 · raw

@ss:0x013e0f9a479bbebad5ed196725eede95/src/src.Src -> List<&2, 0x013e0f9a479bbebad5ed196725eede95/src/finding.Finding>

the rule