Promote: the output of elm make --report=json to a Report value, and a
Report to the text an LLM reads. Pure.
Wire shapes, measured against elm 0.19.1 (fixtures in test/resources/elm):
{"type" "compile-errors" "errors" [{"path" abs "name" module "problems" [{"title" s "region" {"start" {"line" n "column" n}} "message" [chunk ...]}]}]} {"type" "error" "path" "elm.json" "title" s "message" [chunk ...]}
A chunk is a string, or a styled span {"string" s "color" ... "bold" ...}. The report is written to stderr; stdout carries progress only.
Promote: the output of `elm make --report=json` to a Report value, and a
Report to the text an LLM reads. Pure.
Wire shapes, measured against elm 0.19.1 (fixtures in test/resources/elm):
{"type" "compile-errors"
"errors" [{"path" abs "name" module
"problems" [{"title" s "region" {"start" {"line" n "column" n}}
"message" [chunk ...]}]}]}
{"type" "error" "path" "elm.json" "title" s "message" [chunk ...]}
A chunk is a string, or a styled span {"string" s "color" ... "bold" ...}.
The report is written to stderr; stdout carries progress only.(decode s)The JSON object in s, or nil when s is not one.
The JSON object in `s`, or nil when `s` is not one.
(fingerprint report)Identity of a report's problems: equal for the same failure seen twice.
Identity of a report's problems: equal for the same failure seen twice.
(location {:problem/keys [path line column]})src/Main.elm:11:8, as far as the problem is located.
`src/Main.elm:11:8`, as far as the problem is located.
Cap on non-JSON compiler output kept as a problem message.
Cap on non-JSON compiler output kept as a problem message.
(message-text chunks)The plain text of a styled message: colours and underlines dropped.
The plain text of a styled message: colours and underlines dropped.
(problems-of root decoded)Every problem in a decoded report, in compiler order.
Every problem in a decoded report, in compiler order.
(relativize root path)path relative to root when it lies under it, else path unchanged.
`path` relative to `root` when it lies under it, else `path` unchanged.
(render report)(render report
{:keys [max-problems max-chars] :or {max-problems 3 max-chars 4000}})The report as text for a reader that cannot see the terminal. At most
:max-problems problems (default 3) and :max-chars characters
(default 4000); what was left out is counted, never silently dropped.
The report as text for a reader that cannot see the terminal. At most `:max-problems` problems (default 3) and `:max-chars` characters (default 4000); what was left out is counted, never silently dropped.
(report-of root {:keys [exit err] :as result})The Report for a finished compiler process {:exit :out :err}.
The Report for a finished compiler process `{:exit :out :err}`.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |