~/bend-docscommunity

src/rules/laws/closed.bend checks

raw source on the hub · import bolt@1.34.0.0/src/rules/laws/closed.bend as Closed

rule closed: a law in a LAWS.bend with no for/exs binder. A law with no binder holds for the one input it names, which makes it a unit test the checker runs, not a guarantee, and that is so for an equality ({lhs == rhs : T}, including IO(T)) as much as for anything else. Nothing exempts a closed law: quantify it, or delete it. Laws outside LAWS.bend are not held to 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/tree.bend as Tree
import ../../lazy/lazy.bend as Lazy
import ../../syntax/bind.bend as Bind

Definitions

def binds source · line 17 · raw

@body:0x29d5b60953e119edca9d12af485ef065/src/syntax/tree.Node -> Bool

does a law's body bind anything (a for or exs line)?

def name.of source · line 27 · raw

@mm:Maybe<&2, String> -> String

a law's name, ? when it has none

def check.go source · line 34 · raw

@root:0x29d5b60953e119edca9d12af485ef065/src/syntax/tree.Node -> @+path:String -> List<&2, 0x29d5b60953e119edca9d12af485ef065/src/finding.Finding>

def check source · line 48 · raw

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

the rule

def check.role source · line 53 · raw

@rr:0x29d5b60953e119edca9d12af485ef065/src/role.Role -> @ss:0x29d5b60953e119edca9d12af485ef065/src/src.Src -> List<&2, 0x29d5b60953e119edca9d12af485ef065/src/finding.Finding>

the rule, told the file's role (src/role.bend): only a law file is checked