Skip Menu |

This queue is for tickets about the Module-CPANTS-Analyse CPAN distribution.

Report information
The Basics
Id: 126918
Status: open
Priority: 0/
Queue: Module-CPANTS-Analyse

People
Owner: Nobody in particular
Requestors: HMBRAND [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: (no value)
Fixed in: (no value)



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) {
On Wed Aug 22 16:47:56 2018, HMBRAND wrote: Show quoted text
> 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---
I think this is a duplicate of https://github.com/cpants/Module-CPANTS-Analyse/commit/13ba2e0395caaa580301a6e970fd1bf906ae4077 , isn't it?
On Wed Aug 22 03:47:56 2018, HMBRAND wrote: Show quoted text
> 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:
This is wrong for files generated during Makefile.PL such as Storable.pm generated on the fly. Many Kwalitee tests will fails when in the main module is skipped, such as -has_license_in_source_file -has_abstract_in_pod Unfortunately I need a MANIFEST.SKIP file to detect skipped files. This is already a bug in Module::CPANTS::Kwalitee 1.00