Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the Perl-Critic CPAN distribution.

Report information
The Basics
Id: 44986
Status: resolved
Priority: 0/
Queue: Perl-Critic

People
Owner: Nobody in particular
Requestors: user42 [...] zip.com.au
Cc:
AdminCc:

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



Subject: ProhibitVersionStrings versus comments within a "use"
Date: Mon, 13 Apr 2009 08:49:23 +1000
To: bug-Perl-Critic [...] rt.cpan.org
From: Kevin Ryde <user42 [...] zip.com.au>
In the current cvs ProhibitVersionStrings seems to be triggered by a 3-part version number which is in a comment in a use statement, per below. I struck this with some gtk version numbers in comments. The remark in ProhibitVersionStrings.pm about having PPI parse such numbers is probably the best idea. Although v-strings are a case of a dubious idea (floating point verion numbers) made even worse, PPI could helpfully pick out how perl is going to read such a form.
Index: ProhibitVersionStrings.run =================================================================== --- ProhibitVersionStrings.run (revision 3285) +++ ProhibitVersionStrings.run (working copy) @@ -15,6 +15,10 @@ use lib '/usr/lib/perl5/vendor_perl/5.8.8'; # RT #30388 +use Foo::Interface + # as of FooLib 1.2.3 we can use the xyzzy option + 'xyzzy' => 1; + #----------------------------------------------------------------------------- ## name use failure
Proposed fix committed as SVN revision 3288. Instead of just a regex on the contents of the statement, attempted to actually identify the version string. This is made more complicated by the fact that PPI does not correctly parse version strings beginning with a \"v\". The .run file was updated with a test like the example provided in the RT ticket. Tom Wyant
Subject: Re: [rt.cpan.org #44986] ProhibitVersionStrings versus comments within a "use"
Date: Sun, 23 Aug 2009 06:14:57 -0500
To: bug-Perl-Critic [...] rt.cpan.org
From: Elliot Shank <perl [...] galumph.com>
Now that we've got a version of PPI that can give us the version requirement and properly supports v-strings, the code for this policy is a lot simpler and guaranteed correct (as much as PPI can guarantee anything).
Subject: Re: [rt.cpan.org #44986] ProhibitVersionStrings versus comments within a "use"
Date: Tue, 25 Aug 2009 22:21:37 -0500
To: bug-Perl-Critic [...] rt.cpan.org
From: Elliot Shank <perl [...] galumph.com>
Fix released in v1.104.