Koha-QA
view release on metacpan or search on metacpan
lib/Koha/QA/PodChecker.pm view on Meta::CPAN
package Koha::QA::PodChecker;
use Modern::Perl;
use base 'Koha::QA::Base';
use Pod::Checker;
=head1 NAME
Koha::QA::PodChecker - Centralized POD checking
=head1 SYNOPSIS
use Koha::QA::PodChecker;
# With a file
my $checker = Koha::QA::PodChecker->new({file => $file});
# Or with content directly
my $checker = Koha::QA::PodChecker->new({content => $content});
my $is_valid = $checker->check;
my @errors = $checker->errors;
=head1 DESCRIPTION
This module provides centralized POD checking using Pod::Checker.
=head1 METHODS
=head2 new
my $checker = Koha::QA::PodChecker->new({file => $file});
Creates a new PodChecker instance.
=head2 check
my $is_valid = $checker->check;
Checks a Perl file for POD errors and warnings using Pod::Checker.
=head2 errors
my @errors = $checker->errors;
Returns array of error hashrefs, each with:
- error: the error type (pod_checker_error, pod_checker_warning)
=cut
sub check {
my ($self) = @_;
my $file = $self->file;
my $checker = Pod::Checker->new();
my $report = '';
open my $out, '>', \$report or die $!;
$checker->parse_from_file( $file, $out );
my @errors;
( run in 0.635 second using v1.01-cache-2.11-cpan-eb134014566 )