Bug 39149: Make tidy.pl deal with .PL files
This patch adds handling for files with the `.PL` extension to the `tidy.pl` helper script. It will now consider them Perl files and tidy them as appropriate. I opted for explicitly listing `PL` instead of making the existing check case-insensitive because the only files I found with changed case (i.e. Perl scripts that don't have `.pl`) are: $ find . -type f -iname "*.pl" ! -name "*.pl" ./fix-perl-path.PL ./build-resources.PL ./rewrite-config.PL ./Makefile.PL Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This commit is contained in:
parent
da6996c08e
commit
63cba14abd
1 changed files with 3 additions and 2 deletions
|
@ -143,7 +143,7 @@ sub build_git_exclude {
|
|||
}
|
||||
|
||||
sub get_perl_files {
|
||||
my $cmd = sprintf q{git ls-files '*.pl' '*.pm' '*.t' svc opac/svc %s}, build_git_exclude('pl');
|
||||
my $cmd = sprintf q{git ls-files '*.pl' '*.PL' '*.pm' '*.t' svc opac/svc %s}, build_git_exclude('pl');
|
||||
my @files = qx{$cmd};
|
||||
chomp for @files;
|
||||
return @files;
|
||||
|
@ -219,8 +219,9 @@ sub tidy_tt {
|
|||
|
||||
sub get_filetype {
|
||||
my ($file) = @_;
|
||||
return 'pl' if $file =~ m{^svc} || $file =~ m{^opac/svc};
|
||||
return 'pl' if $file =~ m{^svc} || $file =~ m{^opac/svc};
|
||||
return 'pl' if $file =~ m{\.pl$} || $file =~ m{\.pm} || $file =~ m{\.t$};
|
||||
return 'pl' if $file =~ m{\.PL$};
|
||||
|
||||
return 'js' if $file =~ m{\.js$} || $file =~ m{\.ts$} || $file =~ m{\.vue$};
|
||||
|
||||
|
|
Loading…
Reference in a new issue