From 6d6211cf4e1dcd8c4082281b75d314996fc4d10c Mon Sep 17 00:00:00 2001 From: Tomas Cohen Arazi Date: Mon, 17 Feb 2025 17:19:57 +0000 Subject: [PATCH] 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 --- misc/devel/tidy.pl | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/misc/devel/tidy.pl b/misc/devel/tidy.pl index 1445cc30288..5d78d9b7ecb 100755 --- a/misc/devel/tidy.pl +++ b/misc/devel/tidy.pl @@ -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$}; -- 2.48.1