Pentiment

CIHex.pmDocs

Beautiful, compiler-style diagnostic messages for Elixir.

State machine error example

Features

Installation

def deps do
  [{:pentiment, "~> 0.1.0"}]
end

Quick Example

alias Pentiment.{Report, Label, Span, Source}

report =
  Report.error("Undefined variable")
  |> Report.with_code("E001")
  |> Report.with_source("lib/app.ex")
  |> Report.with_label(Label.primary(Span.position(10, 5), "not found in scope"))
  |> Report.with_help("did you mean `user`?")

source = Source.from_file("lib/app.ex")
IO.puts(Pentiment.format(report, source))

Use Cases

Pentiment is designed for:

Documentation

Full API documentation available on HexDocs.