|
Lines 3-9
use Modern::Perl;
Link Here
|
| 3 |
use Test::PerlTidy; |
3 |
use Test::PerlTidy; |
| 4 |
use Test::More; |
4 |
use Test::More; |
| 5 |
|
5 |
|
| 6 |
use Koha::Devel::Files; |
6 |
use Koha::Devel::CI::IncrementalRuns; |
| 7 |
|
7 |
|
| 8 |
my $codespell_version = qx{codespell --version}; |
8 |
my $codespell_version = qx{codespell --version}; |
| 9 |
chomp $codespell_version; |
9 |
chomp $codespell_version; |
|
Lines 11-26
$codespell_version =~ s/-.*$//;
Link Here
|
| 11 |
if ( ( $codespell_version =~ s/\.//gr ) < 220 ) { # if codespell < 2.2.0 |
11 |
if ( ( $codespell_version =~ s/\.//gr ) < 220 ) { # if codespell < 2.2.0 |
| 12 |
plan skip_all => "codespell version $codespell_version too low, need at least 2.2.0"; |
12 |
plan skip_all => "codespell version $codespell_version too low, need at least 2.2.0"; |
| 13 |
} |
13 |
} |
| 14 |
my $dev_files = Koha::Devel::Files->new( { context => 'codespell' } ); |
14 |
|
|
|
15 |
my $ci = Koha::Devel::CI::IncrementalRuns->new( { context => 'codespell' } ); |
| 15 |
my @files; |
16 |
my @files; |
| 16 |
push @files, $dev_files->ls_perl_files; |
17 |
push @files, $ci->get_files_to_test('pl'); |
| 17 |
push @files, $dev_files->ls_tt_files; |
18 |
push @files, $ci->get_files_to_test('tt'); |
| 18 |
push @files, $dev_files->ls_js_files; |
19 |
push @files, $ci->get_files_to_test('js'); |
| 19 |
|
20 |
|
| 20 |
plan tests => scalar @files; |
21 |
plan tests => scalar @files; |
| 21 |
|
22 |
|
|
|
23 |
my %results; |
| 22 |
for my $file (@files) { |
24 |
for my $file (@files) { |
| 23 |
my $output = qx{codespell -d --ignore-words .codespell-ignore $file}; |
25 |
my $output = qx{codespell -d --ignore-words .codespell-ignore $file}; |
| 24 |
chomp $output; |
26 |
chomp $output; |
| 25 |
is( $output, q{} ); |
27 |
is( $output, q{} ) or $results{$file} = 1; |
| 26 |
} |
28 |
} |
|
|
29 |
|
| 30 |
$ci->report_results( \%results ); |