add_findings( @findings )
Appends one or more App::Project::Doctor::Finding objects. Croaks on non-Finding arguments.
exit_code
Returns 0 (clean) or 1 (errors present).
render_text( %opts )
Returns the full text report. Accepted options: verbose (bool).
render_json
Returns findings as a pretty-printed JSON string (requires JSON::MaybeXS).
render_tap
Returns a TAP-format string for CI pipeline consumption.
NAME
App::Project::Doctor::Report - Aggregate and render diagnostic findings
VERSION
0.02
SYNOPSIS
use App::Project::Doctor::Report;
my $report = App::Project::Doctor::Report->new;
$report->add_findings(@findings);
print $report->render_text(verbose => 1);
exit $report->exit_code;
DESCRIPTION
Collects App::Project::Doctor::Finding objects from all checks and renders them as text, JSON, or TAP.
CONSTRUCTOR
new
Creates an empty report ready to receive findings.
API SPECIFICATION
Input
None.
Output
Blessed hashref of type App::Project::Doctor::Report.
FORMAL SPECIFICATION
new : () -> Report
new () == { findings : [] }
METHODS
add_findings( @findings )
API SPECIFICATION
Input
@findings : List of App::Project::Doctor::Finding
Output
Returns $self for chaining. Croaks if any element is not an App::Project::Doctor::Finding.
all_findings
Returns every accumulated Finding in insertion order.
API SPECIFICATION
Input
None.
Output
List of App::Project::Doctor::Finding.
errors / warnings / passes
Return the subset of accumulated findings with the matching severity.
API SPECIFICATION
Input
None.
Output
List of App::Project::Doctor::Finding.
fixable
Returns findings that carry an automated fix coderef.
API SPECIFICATION
Input
None.
Output
List of App::Project::Doctor::Finding.
has_errors
Returns 1 when the report contains at least one error-severity finding, 0 otherwise.
API SPECIFICATION
Input
None.
Output
Integer 1 or 0.
has_warnings
Returns 1 when the report contains at least one warning-severity finding, 0 otherwise.
API SPECIFICATION
Input
None.
Output
Integer 1 or 0.
exit_code
API SPECIFICATION
Input
None.
Output
Integer 0 or 1.
render_text( %opts )
API SPECIFICATION
Input
verbose : Bool default 0
Output
String.
render_json
API SPECIFICATION
Input
None.
Output
UTF-8 JSON string.
render_tap
API SPECIFICATION
Input
None.
Output
TAP string.
MESSAGES
Code | Trigger | Resolution
-----|---------|----------
(none currently defined)
FORMAL SPECIFICATION
Report == { findings : [Finding] }
all_findings : Report -> [Finding]
all_findings r == findings r
errors : Report -> [Finding]
errors r == { f in findings r | severity f = error }
warnings : Report -> [Finding]
warnings r == { f in findings r | severity f = warning }
passes : Report -> [Finding]
passes r == { f in findings r | severity f = pass }
fixable : Report -> [Finding]
fixable r == { f in findings r | is_fixable f }
has_errors : Report -> Bool
has_errors r == |errors r| > 0
has_warnings : Report -> Bool
has_warnings r == |warnings r| > 0
exit_code : Report -> {0,1}
exit_code r == if has_errors r then 1 else 0
AUTHOR
Nigel Horne <njh@nigelhorne.com>
LICENSE
Copyright (C) 2026 Nigel Horne. This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.