NAME

Test::CPAN::Health::Reporter::Terminal - Render a health report as coloured terminal output

SYNOPSIS

use Test::CPAN::Health::Reporter::Terminal;

my $reporter = Test::CPAN::Health::Reporter::Terminal->new;
print $reporter->render($report);

DESCRIPTION

Produces a human-readable, ANSI-coloured summary of a Test::CPAN::Health::Report for display in a terminal. Each check result is rendered on a single line with a status glyph, the check name, and the per-check score. Detail lines are indented beneath failing and warning results. An overall score and pass/warn/fail summary is printed at the end.

Colour can be disabled by setting colour => 0 in the constructor, or automatically when the NO_COLOR environment variable is set (see https://no-color.org) or when STDOUT is not a terminal.

LIMITATIONS

  • Long detail lines are not wrapped; the caller must ensure terminal width is accounted for in test output if needed.

render

PURPOSE

Render a Report to an ANSI-coloured string.

API SPECIFICATION

INPUT

report  Test::CPAN::Health::Report  required

OUTPUT

Scalar string (UTF-8). Does not include a trailing newline on the last line.

MESSAGES

Code  | Severity | Message                            | Resolution
------+----------+------------------------------------+---------------------
TRM01 | FATAL    | report must be a Report object     | Pass a Report instance

FORMAL SPECIFICATION

-- Z schema (placeholder) --
RenderOp
report  : Report
output  : String
-------------------------------------------------------
#output > 0

SIDE EFFECTS

None.

USAGE EXAMPLE

print $reporter->render($report);

AUTHOR

Nigel Horne, <njh at nigelhorne.com>

LICENSE AND COPYRIGHT

Copyright (C) 2025-2026 Nigel Horne.

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.