Somehow we missed we have `.PL` files in the codebase. They are not considered in `tidy.pl` and remain untidy.
Created attachment 178148 [details] [review] 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>
Created attachment 178149 [details] [review] Bug 39149: Tidy .PL files This patch is the result of running: ```shell perl misc/devel/tidy.pl *.PL ``` Commiting raised an error about fix-perl-path.PL calling `warn` which I dismiss for the time being. Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Good news, it seems there aren't other cases of files with slightly diverging extensions that escaped tidying. After looking at all the stuff not having the most common extensions: find . -type f -not -path "./.git/*" -not -path "./misc/translator/po/.git/*" -regextype posix-egrep -not -regex ".*\.(sql|pl|yml|md|yaml|js|txt|xml|json|xsl|chr|pm|t|ts|mrc|csv|inc|pod|att|tag|abs|mar|cfg|conf|properties|ods|po|png|svg|idx|gif|tt|css|vue|html|jpg|in|ogg|woff|woff2|ttf|map|scss|map|py|pref|sh|pdf|odt)$"
Created attachment 178150 [details] [review] 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>
Created attachment 178151 [details] [review] Bug 39149: Tidy .PL files This patch is the result of running: ```shell perl misc/devel/tidy.pl *.PL ``` Commiting raised an error about fix-perl-path.PL calling `warn` which I dismiss for the time being. Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
It works! :) Testing notes: apply last commit of Bug 39096 before this, otherwise it won't apply. Because that follow-up isn't on main yet. Bug 39096: Add .git-blame-ignore-revs mapping to Makefile.PL
Created attachment 178152 [details] [review] Bug 39149: Make perltidy.t also check .PL files Now perltidy.t will check 2958 files instead of 2954. Which matches with the 4 .PL files.
Created attachment 178170 [details] [review] Bug 39149: Make perltidy.t also check .PL files Now perltidy.t will check 2958 files instead of 2954. Which matches with the 4 .PL files. Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Pushed for 25.05! Well done everyone, thank you!
Added a commit to koha-testing-docker for the pre-commit git hooks https://gitlab.com/koha-community/koha-testing-docker/-/commit/d2b480e2c2462b155153d57bf246de20c4481266