Subject: | Patch for _is_backup in Perl::Critic::Utils |
Date: | Mon, 17 Jun 2013 12:55:51 -0700 |
To: | bug-Perl-Critic [...] rt.cpan.org |
From: | Steve Cayford <scfrd1 [...] gmail.com> |
Hi,
The all_perl_files routine returns files named like #filename# when
searching through directories since the regex expects to be looking at
only the filename rather than the whole path.
Here's a simple patch for that if you're interested...
--- Perl/Critic/Utils.pm~ 2013-06-17 12:35:49.378382179 -0700
+++ Perl/Critic/Utils.pm 2013-06-17 12:42:08.548773772 -0700
@@ -1117,6 +1117,7 @@
sub _is_backup {
my ($file) = @_;
+ ( undef, undef, $file ) = File::Spec->splitpath( $file );
return 1 if $file =~ m{ [.] swp \z}xms;
return 1 if $file =~ m{ [.] bak \z}xms;
return 1 if $file =~ m{ ~ \z}xms;