Subject: | .svn directories incorrectly filtered out |
Test::Strict filters out any directory containing 'svn' in its name,
rather than just directories named .svn, due to an error in this regex:
return if ($File::Find::dir =~ m![\\/]?CVS[\\/]|[\\/]?.svn[\\/]!);
# Filter out cvs or subversion dirs/
The period in .svn should be escaped, and [\\/]? should be replaced by
(?:^|[\\/]) to avoid matching just part of a directory name:
return if ($File::Find::dir =~
m!(?:^|[\\/])CVS[\\/]|(?:^|[\\/])\.svn[\\/]!);
# Filter out cvs or subversion dirs/
The other two regexes should have [\\/]? replaced by (?:^|[\\/]) as well.
Patch attached.
Subject: | test-strict-regex.patch |
diff -uw -r Test-Strict-0.14.orig/lib/Test/Strict.pm Test-Strict-0.14/lib/Test/Strict.pm
--- Test-Strict-0.14.orig/lib/Test/Strict.pm 2010-02-13 19:49:40.000000000 -0500
+++ Test-Strict-0.14/lib/Test/Strict.pm 2010-03-01 14:08:42.000000000 -0500
@@ -123,9 +123,9 @@
: File::Spec->catdir($Bin, $updir);
my @found;
my $want_sub = sub {
- return if ($File::Find::dir =~ m![\\/]?CVS[\\/]|[\\/]?.svn[\\/]!); # Filter out cvs or subversion dirs/
- return if ($File::Find::dir =~ m![\\/]?blib[\\/]libdoc$!); # Filter out pod doc in dist
- return if ($File::Find::dir =~ m![\\/]?blib[\\/]man\d$!); # Filter out pod doc in dist
+ return if ($File::Find::dir =~ m!(?:^|[\\/])CVS[\\/]|(?:^|[\\/])\.svn[\\/]!); # Filter out cvs or subversion dirs/
+ return if ($File::Find::dir =~ m!(?:^|[\\/])blib[\\/]libdoc$!); # Filter out pod doc in dist
+ return if ($File::Find::dir =~ m!(?:^|[\\/])blib[\\/]man\d$!); # Filter out pod doc in dist
return unless (-f $File::Find::name && -r _);
push @found, File::Spec->canonpath( File::Spec->no_upwards( $File::Find::name ) );
};