Lines 3-26
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; |
7 |
|
6 |
my $codespell_version = qx{codespell --version}; |
8 |
my $codespell_version = qx{codespell --version}; |
7 |
chomp $codespell_version; |
9 |
chomp $codespell_version; |
8 |
$codespell_version =~ s/-.*$//; |
10 |
$codespell_version =~ s/-.*$//; |
9 |
if ( ( $codespell_version =~ s/\.//gr ) < 220 ) { # if codespell < 2.2.0 |
11 |
if ( ( $codespell_version =~ s/\.//gr ) < 220 ) { # if codespell < 2.2.0 |
10 |
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"; |
11 |
} |
13 |
} |
|
|
14 |
my $dev_files = Koha::Devel::Files->new( { context => 'codespell' } ); |
12 |
my @files; |
15 |
my @files; |
13 |
push @files, |
16 |
push @files, $dev_files->ls_perl_files; |
14 |
qx{git ls-files '*.pl' '*.PL' '*.pm' '*.t' ':(exclude)installer/data/mysql/updatedatabase.pl' ':(exclude)installer/data/mysql/update22to30.pl' ':(exclude)installer/data/mysql/db_revs/241200035.pl' ':(exclude)misc/cronjobs/build_browser_and_cloud.pl'}; |
17 |
push @files, $dev_files->ls_tt_files; |
15 |
push @files, qx{git ls-files svc opac/svc}; # Files without extension |
18 |
push @files, $dev_files->ls_js_files; |
16 |
push @files, qx{git ls-files '*.tt' '*.inc'}; |
|
|
17 |
push @files, |
18 |
qx{git ls-files '*.js' '*.ts' '*.vue' ':(exclude)koha-tmpl/intranet-tmpl/lib' ':(exclude)koha-tmpl/intranet-tmpl/js/Gettext.js' ':(exclude)koha-tmpl/opac-tmpl/lib' ':(exclude)koha-tmpl/opac-tmpl/bootstrap/js/Gettext.js'}; |
19 |
|
19 |
|
20 |
plan tests => scalar @files; |
20 |
plan tests => scalar @files; |
21 |
|
21 |
|
22 |
for my $file (@files) { |
22 |
for my $file (@files) { |
23 |
chomp $file; |
|
|
24 |
my $output = qx{codespell -d --ignore-words .codespell-ignore $file}; |
23 |
my $output = qx{codespell -d --ignore-words .codespell-ignore $file}; |
25 |
chomp $output; |
24 |
chomp $output; |
26 |
is( $output, q{} ); |
25 |
is( $output, q{} ); |