A problem Schooner.check/3 found in a script without running it.
:severity—:errorfor a problem that fails the script if evaluation reaches it,:warningfor one that may not.:code— what kind of problem it is::read_error— the source doesn't parse.:syntax_error— a special form, macro use orimportset is malformed.:unknown_library— an(import ...)names a library the environment doesn't provide.:unbound— a name isn't bound by the environment, an import, or a definition in the script.:arity— a call's argument count can't match the arity of the procedure it calls.
:message— a description for people, without the location.:location— theSchooner.Locationof the problem, naming the file passed toSchooner.check/3as:file, ornilwhen no position is known.
Summary
Functions
Render a diagnostic on one line, as mix schooner.check prints it:
file:line:col: severity[code]: message.
Types
@type code() :: :read_error | :syntax_error | :unknown_library | :unbound | :arity
@type severity() :: :error | :warning
@type t() :: %Schooner.Diagnostic{ code: code(), location: Schooner.Location.t() | nil, message: binary(), severity: severity() }
Functions
Render a diagnostic on one line, as mix schooner.check prints it:
file:line:col: severity[code]: message.
iex> Schooner.Diagnostic.format(%Schooner.Diagnostic{
...> severity: :error,
...> code: :unbound,
...> message: "unbound variable: unit-prise",
...> location: %Schooner.Location{file: "draft.scm", line: 1, column: 27}
...> })
"draft.scm:1:27: error[unbound]: unbound variable: unit-prise"A location without a file renders as line:col; a diagnostic
without a location starts at the severity.