This is an automated email from the git hooks/post-receive script.

guillem pushed a commit to branch main
in repository dpkg.

View the commit online:
https://git.dpkg.org/cgit/dpkg/dpkg.git/commit/?id=eefb59caedd6658ec7c3a8f26724774996ff8dd8

commit eefb59caedd6658ec7c3a8f26724774996ff8dd8
Author: Guillem Jover <[email protected]>
AuthorDate: Wed Jun 11 02:19:53 2025 +0200

    Test::Dpkg: Refactor all_shell_files() function
    
    Add this new function from the current static list of shell files in the
    shellcheck.t unit test.
---
 scripts/Test/Dpkg.pm | 20 ++++++++++++++++++++
 t/shellcheck.t       | 16 +++-------------
 2 files changed, 23 insertions(+), 13 deletions(-)

diff --git a/scripts/Test/Dpkg.pm b/scripts/Test/Dpkg.pm
index cc171117d..a21774b50 100644
--- a/scripts/Test/Dpkg.pm
+++ b/scripts/Test/Dpkg.pm
@@ -34,6 +34,7 @@ use v5.36;
 
 our @EXPORT_OK = qw(
     all_po_files
+    all_shell_files
     all_perl_files
     all_perl_modules
     test_get_po_dirs
@@ -57,6 +58,7 @@ our %EXPORT_TAGS = (
     ) ],
     paths => [ qw(
         all_po_files
+        all_shell_files
         all_perl_files
         all_perl_modules
         test_get_po_dirs
@@ -150,6 +152,24 @@ sub all_po_files
     return _test_get_files(qr/\.(?:po|pot)$/, [ test_get_po_dirs() ]);
 }
 
+sub all_shell_files
+{
+    my @files = qw(
+        autogen
+        build-aux/gen-release
+        build-aux/get-vcs-id
+        build-aux/get-version
+        build-aux/run-script
+        debian/dpkg.cron.daily
+        debian/dpkg.postrm
+        src/dpkg-db-backup.sh
+        src/dpkg-db-keeper.sh
+        src/dpkg-maintscript-helper.sh
+    );
+
+    return @files;
+}
+
 sub all_perl_files
 {
     return _test_get_files(qr/\.(?:PL|pl|pm|t)$/, [ test_get_perl_dirs() ]);
diff --git a/t/shellcheck.t b/t/shellcheck.t
index 5ad0ded91..acbc09858 100644
--- a/t/shellcheck.t
+++ b/t/shellcheck.t
@@ -16,7 +16,7 @@
 use v5.36;
 
 use Test::More;
-use Test::Dpkg qw(:needs);
+use Test::Dpkg qw(:needs :paths);
 
 test_needs_author();
 test_needs_command('shellcheck');
@@ -30,18 +30,8 @@ my @files_todo = qw(
     dselect/methods/media/setup.sh
     dselect/methods/media/update.sh
 );
-my @files = qw(
-    autogen
-    build-aux/gen-release
-    build-aux/get-vcs-id
-    build-aux/get-version
-    build-aux/run-script
-    debian/dpkg.cron.daily
-    debian/dpkg.postrm
-    src/dpkg-db-backup.sh
-    src/dpkg-db-keeper.sh
-    src/dpkg-maintscript-helper.sh
-);
+my @files = all_shell_files();
+
 my @shellcheck_opts = (
     '--external-sources', # Allow checking external source files.
     '--exclude=SC1090', # Allow non-constant source.

-- 
Dpkg.Org's dpkg

Reply via email to