Skip Menu |
 

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

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

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

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



Subject: new kwalitee metric: underscore in $VERSION
Download (untitled) / with headers
text/plain 525b
This is an acceptable way of indicating a trial release: our $VERSION = '1.002_003'; $VERSION = eval $VERSION; This is not: our $VERSION = '1.200_003'; as if someone later says: use Foo 1.003; they will get the warning: Argument "1.002_003" isn't numeric in subroutine entry at <line number of the use statement> We should be able to detect this by loading the .pm file (inside an eval, in case it has errors -- maybe inside a Safe compartment?) and looking for $VERSION variables in all defined namespaces.
Download (untitled) / with headers
text/plain 940b
On 2015-09-30 18:52:26, ETHER wrote: Show quoted text
> This is an acceptable way of indicating a trial release: > > our $VERSION = '1.002_003'; > $VERSION = eval $VERSION; > > This is not: > > our $VERSION = '1.200_003'; > > as if someone later says: use Foo 1.003; they will get the warning: > Argument "1.002_003" isn't numeric in subroutine entry at <line number > of the use statement> > > We should be able to detect this by loading the .pm file (inside an > eval, in case it has errors -- maybe inside a Safe compartment?) and > looking for $VERSION variables in all defined namespaces.
Even the eval trick is problematic: a trailing zero gets lost this way. This happened to me once, check out the release history of https://metacpan.org/release/Tk --- 804.030 is listed there as 804.03. Currently I strip the underscore with a s///: $VERSION =~ s{_}{}; (no /g, as I expect that there's only one underscore ever in the $VERSION string)
Download (untitled) / with headers
text/plain 1.2k
On Mon Oct 05 15:48:33 2015, SREZIC wrote: Show quoted text
> On 2015-09-30 18:52:26, ETHER wrote:
> > This is an acceptable way of indicating a trial release: > > > > our $VERSION = '1.002_003'; > > $VERSION = eval $VERSION; > > > > This is not: > > > > our $VERSION = '1.200_003'; > > > > as if someone later says: use Foo 1.003; they will get the warning: > > Argument "1.002_003" isn't numeric in subroutine entry at <line > > number > > of the use statement> > > > > We should be able to detect this by loading the .pm file (inside an > > eval, in case it has errors -- maybe inside a Safe compartment?) and > > looking for $VERSION variables in all defined namespaces.
It should be done in a Safe compartment that denies to load other stuff (and other dangerous/irrelevant operations) so that we don't need to care dependencies of a target module. Show quoted text
> > Even the eval trick is problematic: a trailing zero gets lost this > way. This happened to me once, check out the release history of > https://metacpan.org/release/Tk --- 804.030 is listed there as 804.03. > Currently I strip the underscore with a s///: > > $VERSION =~ s{_}{}; > > (no /g, as I expect that there's only one underscore ever in the > $VERSION string)
Proper treatment of trailing 0(s) in a version may worth another metric.
Download (untitled) / with headers
text/plain 817b
Show quoted text
> On Mon Oct 05 15:48:33 2015, SREZIC wrote:
Show quoted text
> > Even the eval trick is problematic: a trailing zero gets lost this > > way. This happened to me once, check out the release history of > > https://metacpan.org/release/Tk --- 804.030 is listed there as > > 804.03. > > Currently I strip the underscore with a s///: > > > > $VERSION =~ s{_}{};
Very good point! I'll train my fingers to type s/_// instead of eval. On 2015-10-05 00:20:27, ISHIGAKI wrote: Show quoted text
> Proper treatment of trailing 0(s) in a version may worth another > metric.
There's a few things we could check with versions - either all combined into one metric, or simply grouped into a single Kwalitee module -- I'd bring Dave Golden and Leon Timmermans into the loop to flesh out those as they have been closest to the ground on version issues lately. :)


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.