NAME

Koha::QA::PerlCritic - Centralized Perl criticism checking using Perl::Critic

SYNOPSIS

use Koha::QA::Critic::Perl;

# With a file
my $checker = Koha::QA::PerlCritic->new({file => $file, perlcriticrc => $perlcriticrc});

# Or with content directly
my $checker = Koha::QA::PerlCritic->new({content => $file_content, perlcriticrc => $perlcriticrc});

my $is_valid = $checker->check;
my @errors = $checker->errors;

DESCRIPTION

This module provides centralized Perl criticism checking using Perl::Critic.

METHODS

new

my $checker = Koha::QA::Critic::Perl->new({file => $file, perlcriticrc => $perlcriticrc});

Creates a new PerlCritic instance.

Arguments: - perlcriticrc: Optional path to .perlcriticrc file

check

my $is_valid = $checker->check;

Checks a Perl file for Perl::Critic violations.

errors

my @errors = $checker->errors;

Returns array of error hashrefs, each with: - error: the error type (perlcritic, no_perlcriticrc)

AUTHORS

Jonathan Druart <jonathan.druart@bugs.koha-community.org>

COPYRIGHT

Copyright 2026 Koha Development Team

LICENSE

This file is part of Koha.

Koha 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 3 of the License, or (at your option) any later version.