Cherry.Check.Diagnostic (cherry v0.3.0)

Copy Markdown View Source

One structured finding from cherry.check (DESIGN.md §6): the file it came from, the rule that fired, what is wrong, and how bad it is.

Structured because the check loop is an agent's verifier: build → check → fix diagnostics → repeat.

Summary

Functions

Errors first, then warnings; stable by file and rule within.

Types

severity()

@type severity() :: :error | :warning

t()

@type t() :: %Cherry.Check.Diagnostic{
  file: String.t(),
  line: pos_integer() | nil,
  message: String.t(),
  rule: String.t(),
  severity: severity()
}

Functions

sort(diagnostics)

@spec sort([t()]) :: [t()]

Errors first, then warnings; stable by file and rule within.