Skip Menu |
 

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

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

People
Owner: Nobody in particular
Requestors: duncan.garland [...] ntlworld.com
Cc:
AdminCc:

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



Subject: Misleading error in Module::CPANTS::Kwalitee::Uses
Date: Sat, 16 Aug 2014 16:35:33 +0100
To: <bug-Module-CPANTS-Analyse [...] rt.cpan.org>
From: "Duncan Garland" <duncan.garland [...] ntlworld.com>
Download (untitled) / with headers
text/plain 823b
Hi, I missed the extension off one of the files listed in META.yml. Test::Kwalitee reported this as a failure to use strict. It quite obviously did use strict, and it took me ages to track down the true cause. This section of code: 69: my $p = Module::ExtractUse->new; 70: my $file = catfile($distdir,$_->{file}); 71: $p->extract_use($file) if -f $file; 72: $_->{uses} = $p->used; 73 Checks if the file exists, but doesn't issue a warning or an error if it doesn't. It simply passes on an empty list and the module later reports that The module does not use strict. Can this be changed to issue a message? Even something simple would help: if ( -f $file ) { $p->extract_use($file); else { warn "File $file which is listed in META.yml does not exist." } Thanks
Download (untitled) / with headers
text/plain 1.6k
On Sun Aug 17 00:35:47 2014, duncan.garland@ntlworld.com wrote: Show quoted text
> Hi, > > I missed the extension off one of the files listed in META.yml. > > Test::Kwalitee reported this as a failure to use strict. It quite obviously > did use strict, and it took me ages to track down the true cause. > > This section of code: > > 69: my $p = Module::ExtractUse->new; > 70: my $file = catfile($distdir,$_->{file}); > 71: $p->extract_use($file) if -f $file; > 72: $_->{uses} = $p->used; > 73 > > Checks if the file exists, but doesn't issue a warning or an error if it > doesn't. It simply passes on an empty list and the module later reports that > The module does not use strict. > > Can this be changed to issue a message? Even something simple would help: > > if ( -f $file ) { > $p->extract_use($file); > else { > warn "File $file which is listed in META.yml does not exist." > } > > Thanks >
Hi. Thanks for the feedback. Could you try the latest developer release of Module::CPANTS::Analyse (0.93_03) and see what's happens? Though it doesn't take your approach, I suppose it'll do better analysis wrt use_strict/warnings. Generally speaking, Module::CPANTS::Analyse/Kwalitee should not warn nor die for human friendliness because it's primarily designed for automated analysing (for the CPANTS website). If something wrong happens for a particular metric, it should be reported as an error (stored in d->{error}{$metric}, if it is reasonably related to the metric), or ignored for the metric and taken care of by other (possible new) metric for it. In this case, inexistent file should be ignored as it can't have use statements.
Download (untitled) / with headers
text/plain 387b
On 2014-08-16 08:35:47, duncan.garland@ntlworld.com wrote: Show quoted text
> Can this be changed to issue a message? Even something simple would help: > > if ( -f $file ) { > $p->extract_use($file); > else { > warn "File $file which is listed in META.yml does not exist." > }
As a side note, this plugin might be useful to you: https://metacpan.org/pod/Dist::Zilla::Plugin::CheckPrereqsIndexed


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.