Ignorelint::Formatter
Inherits Reference < Object
Abstract base class for all output formatters.
Subclasses must implement the three-phase lifecycle:
start: called before processing beginsformat_file: called once per linted filefinish: called after all files are processed
The io parameter is the output stream (usually STDOUT). Formatters
write directly to it — they do not buffer internally (except for
JSON/SARIF which need the complete structure before writing).
Crystal note: abstract class vs module
We use an abstract class (not a module) because formatters need per-instance
state (e.g., HumanFormatter stores @color, JsonFormatter collects
@results). Modules in Crystal cannot have per-instance state when used
via include — they share state with the including type.
Instance methods
Called once after all files are processed. Use for document footers and final aggregation (e.g., JSON total count).
Called once per file with the lint results for that file.
Called once before any files are processed. Use for document headers.