Subject: | Do not test issues on files in MANIFEST.SKIP |
Files listed in MANIFEST.SKIP will not ever make it to the CPAN distribution. Some of these files might be present for testing and some may even be symlinks.
Here is how to skip those:
--8<---
diff -purd a/lib/Module/CPANTS/Kwalitee/Files.pm b/lib/Module/CPANTS/Kwalitee/Files.pm
--- a/lib/Module/CPANTS/Kwalitee/Files.pm 2014-11-24 05:06:55.000000000 +0100
+++ b/lib/Module/CPANTS/Kwalitee/Files.pm 2018-08-22 09:46:18.443179949 +0200
@@ -5,11 +5,31 @@ use File::Find::Object;
use File::Spec::Functions qw(catfile);
use File::stat;
-our $VERSION = '0.96';
+our $VERSION = '0.96_01';
$VERSION = eval $VERSION; ## no critic
sub order { 15 }
+my $manifest_skip = qr{^\xFF{100}};
+if (open my $msh, "<", "MANIFEST.SKIP") {
+ my @skip;
+ while (<$msh>) {
+ s/[\s\r\n]+\z//;
+ if (s{/$}{} || -d $_) {
+ push @skip, $_, "$_/.*";
+ }
+ elsif (-f (my ($pf = $_) =~ s/\\//g)) {
+ push @skip, quotemeta $pf;
+ }
+ else {
+ push @skip, (s/\$$// ? $_ : "$_.*");
+ }
+ }
+ close $msh;
+ $manifest_skip = join "|" => reverse sort @skip;
+ $manifest_skip = qr{^($manifest_skip)$};
+}
+
##################################################################
# Analyse
##################################################################
@@ -36,6 +56,8 @@ sub analyse {
(my $path = $name) =~ s!^\Q$distdir\E(?:/|$)!! or next;
next if $path eq '';
+ $path =~ $manifest_skip and next;
+
if (-d $name) {
$dirs{$path} ||= {};
if (-l $name) {
-->8---
Subject: | patch.diff |
diff -purd a/lib/Module/CPANTS/Kwalitee/Files.pm b/lib/Module/CPANTS/Kwalitee/Files.pm
--- a/lib/Module/CPANTS/Kwalitee/Files.pm 2014-11-24 05:06:55.000000000 +0100
+++ b/lib/Module/CPANTS/Kwalitee/Files.pm 2018-08-22 09:46:18.443179949 +0200
@@ -5,11 +5,31 @@ use File::Find::Object;
use File::Spec::Functions qw(catfile);
use File::stat;
-our $VERSION = '0.96';
+our $VERSION = '0.96_01';
$VERSION = eval $VERSION; ## no critic
sub order { 15 }
+my $manifest_skip = qr{^\xFF{100}};
+if (open my $msh, "<", "MANIFEST.SKIP") {
+ my @skip;
+ while (<$msh>) {
+ s/[\s\r\n]+\z//;
+ if (s{/$}{} || -d $_) {
+ push @skip, $_, "$_/.*";
+ }
+ elsif (-f (my ($pf = $_) =~ s/\\//g)) {
+ push @skip, quotemeta $pf;
+ }
+ else {
+ push @skip, (s/\$$// ? $_ : "$_.*");
+ }
+ }
+ close $msh;
+ $manifest_skip = join "|" => reverse sort @skip;
+ $manifest_skip = qr{^($manifest_skip)$};
+}
+
##################################################################
# Analyse
##################################################################
@@ -36,6 +56,8 @@ sub analyse {
(my $path = $name) =~ s!^\Q$distdir\E(?:/|$)!! or next;
next if $path eq '';
+ $path =~ $manifest_skip and next;
+
if (-d $name) {
$dirs{$path} ||= {};
if (-l $name) {