From 4868e5eecbd2714042233093be65d2708ad63e6c Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Tue, 18 Jul 2023 14:06:43 +0200 Subject: [PATCH] Bug 34303: Loop over pl and pm from the git repo We don't want to include files that are not in the git index. --- t/00-testcritic.t | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/t/00-testcritic.t b/t/00-testcritic.t index c60122e1d74..c384459f993 100755 --- a/t/00-testcritic.t +++ b/t/00-testcritic.t @@ -14,5 +14,10 @@ if ( $EVAL_ERROR ) { } Test::Perl::Critic->import( -profile => '.perlcriticrc'); -my @dirs = `git ls-tree -d --name-only master`; -all_critic_ok(@dirs) if @dirs; +my @files = `git ls-tree -r HEAD --name-only | grep -E '.*\\.(pl|pm)'`; +for my $file ( @files ) { + chomp $file; + critic_ok($file); +} + +done_testing(); -- 2.25.1