5 # This script can be used to run perlcritic on perl files in koha
6 # It calls its own custom perlcriticrc
7 # The script is purely optional requiring Test::Perl::Critic to be installed
8 # and the environment variable TEST_QA to be set
9 # At present only the directories in @dirs will pass the tests in 'Gentle' mode
13 use English
qw(-no_match_vars);
15 my @all_koha_dirs = qw( acqui admin authorities basket C4 catalogue cataloguing circ debian errors
16 labels members misc offline_circ opac patroncards reports reserve reviews rotating_collections
17 serials sms suggestion t tags test tools virtualshelves);
19 my @dirs = qw( acqui admin authorities basket catalogue circ debian errors offline_circ reserve
20 reviews rotating_collections serials sms virtualshelves );
22 if ( not $ENV{TEST_QA
} ) {
23 my $msg = 'Author test. Set $ENV{TEST_QA} to a true value to run';
24 plan
( skip_all
=> $msg );
27 eval { require Test
::Perl
::Critic
; };
30 my $msg = 'Test::Perl::Critic required to criticise code,';
31 plan
( skip_all
=> $msg );
34 my $rcfile = File
::Spec
->catfile( 't', 'perlcriticrc' );
35 Test
::Perl
::Critic
->import( -profile
=> $rcfile);