From a2e84b1ebd3e6a6b92d140d4c7d1355f1a146574 Mon Sep 17 00:00:00 2001 From: Tomas Cohen Arazi Date: Fri, 27 Jun 2025 13:54:29 +0000 Subject: [PATCH] Bug 40261: Teach tidy.pl how to handle build-git-snapshot This patch makes the `tidy.pl` script handle the mentioned script as a Perl script. To test: 1. Run: $ ktd --shell k$ perl misc/devel/tidy.pl debian/build-git-snapshot => FAIL: You get: ``` Cannot guess filetype for debian/build-git-snapshot at misc/devel/tidy.pl line 234. ``` 2. Apply this patch 3. Repeat 1 => SUCCESS: It tidies the file! 4. Reset to the current head k$ git reset --hard HEAD 5. Apply the tidy patch 6. Repeat 1 7. Run: k$ git diff => SUCCESS: No diff, the file is tidy 8. Sign off :-D --- misc/devel/tidy.pl | 1 + 1 file changed, 1 insertion(+) diff --git a/misc/devel/tidy.pl b/misc/devel/tidy.pl index 2ab5c20c33a..3fa7e2ced87 100755 --- a/misc/devel/tidy.pl +++ b/misc/devel/tidy.pl @@ -223,6 +223,7 @@ sub tidy_tt { sub get_filetype { my ($file) = @_; + return 'pl' if $file =~ m{^debian/build-git-snapshot$}; 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$}; -- 2.39.5