Koha/t/00-testcritic.t
Marcel de Rooy 2bc251cfdd
Bug 34303: Only perlcritic files from git repo
Test plan:
Run t/00-testcritic.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

JD amended patch: tidy

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-07-18 14:07:42 -03:00

18 lines
489 B
Perl
Executable file

#!/usr/bin/env perl
# This script can be used to run perlcritic on perl files in koha
use Modern::Perl;
use Test::More;
use English qw(-no_match_vars);
eval { require Test::Perl::Critic; };
if ( $EVAL_ERROR ) {
my $msg = 'Test::Perl::Critic required to criticise code,';
plan( skip_all => $msg );
}
Test::Perl::Critic->import( -profile => '.perlcriticrc' );
my @files = map { chomp; $_ } `git ls-tree -r master --name-only`; # only files part of git
all_critic_ok(@files);