LemonCore.Doctor.Check (lemon_core v0.1.0)

View Source

A single diagnostic check result.

Each check has a name, a status, a human-readable message, and an optional remediation hint to help the user fix failing checks.

Statuses

StatusMeaning
:passCheck succeeded — no action needed.
:warnCheck found a potential problem — system may still work.
:failCheck failed — action required.
:skipCheck was intentionally not run (e.g. dependency not available).

Summary

Functions

Returns the ANSI color atom for a status.

Builds a failing check.

Returns the display label for a status.

Builds a passing check.

Builds a skipped check.

Builds a warning check.

Types

status()

@type status() :: :pass | :warn | :fail | :skip

t()

@type t() :: %LemonCore.Doctor.Check{
  message: String.t() | nil,
  name: String.t(),
  remediation: String.t() | nil,
  status: status()
}

Functions

color(atom)

@spec color(status()) :: atom()

Returns the ANSI color atom for a status.

fail(name, message, remediation \\ nil)

@spec fail(String.t(), String.t(), String.t() | nil) :: t()

Builds a failing check.

label(atom)

@spec label(status()) :: String.t()

Returns the display label for a status.

pass(name, message \\ "OK")

@spec pass(String.t(), String.t()) :: t()

Builds a passing check.

skip(name, message \\ "Skipped")

@spec skip(String.t(), String.t()) :: t()

Builds a skipped check.

warn(name, message, remediation \\ nil)

@spec warn(String.t(), String.t(), String.t() | nil) :: t()

Builds a warning check.