def check.go
bolt@1.27.0.0 · src/rules/style/param.bend:49
import bolt@1.27.0.0/src/rules/style/param.bend as Param
import Base
import bolt@1.27.0.0/src/finding.bend as F
import bolt@1.27.0.0/src/syntax/bind.bend as Bind
49def check.go(binds: List<&2, Bind.Bind>, +path: String) -> List<&2, F.Finding>:
50 match binds:
51 case Nil{}:
52 Nil{}
53 case Con{Bind.Bind{+nm, +line, +col, +kind, +note}, rest}:
54 +more = check.go(rest, path)
55 +hit = Bool.and(check.is_param(kind), Bool.and(check.short(nm), Bool.not(check.allowed(nm, note))))
56 Bool.pick(List<&2, F.Finding>, hit,
57 F.Finding{path, line, col, U32.from_nat(String.length(nm)), "param",
58 "Parameter " ++ nm ++ " is too short; use at least 2 characters."} <> more, more)