src/finding.bend
bolt@1.26.0.0 · 24 lines · 3 definitions
1
2
3
4
5
6
7
8import Base
9import bolt@1.26.0.0/src/config.bend as Config
10import bolt@1.26.0.0/src/codes.bend as Codes
11
12
13type Finding is Data:
14 Finding{path: String, line: U32, col: U32, len: U32, rule: String, msg: String}
15
16
17type Graded is Data:
18 Graded{level: Config.Level, finding: Finding}
19
20
21def show_graded(gg: Graded) -> String:
22 Graded{level, Finding{path, line, col, len, rule, msg}} = gg
23 path ++ ":" ++ U32.show((line + 1 : U32)) ++ ":" ++ U32.show((col + 1 : U32)) ++ ": " ++ Config.show(level) ++ ": "
24 ++ Codes.code(rule) ++ ": " ++ msg