def graded

bolt@1.27.0.0 · src/rules.bend:178

import bolt@1.27.0.0/src/rules.bend as Rules
import Base
import bolt@1.27.0.0/src/finding.bend as F
import bolt@1.27.0.0/src/config.bend as Config

178# the findings at the levels a config gives their rules; the ones set off
179# are dropped
180def graded(+cfg: Config.Config, fs: List<&2, F.Finding>) -> List<&2, F.Graded>:
181  match fs:
182    case Nil{}:
183      Nil{}
184    case Con{F.Finding{path, line, col, len, +rule, msg}, rest}:
185      +more = graded(cfg, rest)
186      +l = Config.level(cfg, group(rule), rule)
187      Bool.pick(List<&2, F.Graded>, Config.is_off(l), more,
188        F.Graded{l, F.Finding{path, line, col, len, rule, msg}} <> more)

Uses (8)

Used by (2)