Skip Menu |

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

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

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

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



Subject: Recognize Modern::Perl
Putting 'use Modern::Perl;' in your script means you require at least perl 5.10. Compatibility::PerlMinimumVersionAndWhy should recognize this and treat 'use Modern::Perl;' as equivalent to an explicit perl version requirement.
On 2014-11-12 08:07:07, EDAVIS wrote: Show quoted text
> Putting 'use Modern::Perl;' in your script means you require at least > perl 5.10. > Compatibility::PerlMinimumVersionAndWhy should recognize this and > treat 'use Modern::Perl;' as equivalent to an explicit perl version > requirement.
See also the similar check in Module::CPANTS::Analyse, which recognizes a bunch of common modules that add version requirements and/or strict and warning pragmas.
CC: bug-Perl-Critic-Pulp [...] rt.cpan.org
Subject: Re: [rt.cpan.org #100290] Recognize Modern::Perl
Date: Thu, 13 Nov 2014 19:47:22 +1100
To: EDAVIS [...] cpan.org
From: Kevin Ryde <user42_kevin [...] yahoo.com.au>
"EDAVIS via RT" <bug-Perl-Critic-Pulp@rt.cpan.org> writes: Show quoted text
> > Putting 'use Modern::Perl;' in your script means you require at least > perl 5.10.
Hmm. Personally I don't think I rate that sort of thing. Not that I object to more than one way to do it ... I go from Perl::Critic::Document highest_explicit_perl_version(). How would they feel about looking for extra pragmatic modules which are proxies for a minimum version? That might give the benefit to all perlcritic policies.
There was some (quite unnecessary IMHO) controversy about this in Perl::Critic, see https://github.com/Perl-Critic/Perl-Critic/issues/270
Subject: Re: [rt.cpan.org #100290] Recognize Modern::Perl
Date: Sun, 04 Jan 2015 17:55:36 +1100
To: "EDAVIS via RT" <bug-Perl-Critic-Pulp [...] rt.cpan.org>
From: Kevin Ryde <user42_kevin [...] yahoo.com.au>
"EDAVIS via RT" <bug-Perl-Critic-Pulp@rt.cpan.org> writes: Show quoted text
> > There was some (quite unnecessary IMHO) controversy about this in > Perl::Critic, see > https://github.com/Perl-Critic/Perl-Critic/issues/270
Hmm. No offence, but the dates idea seems to obscure the actual requirements. At any rate I put a bit in version 89 to treat as 5.10.
Thanks for looking at this. However, even with version 89 I still see warnings such as ./job:9:1:_perl_5006_pragmas requires 5.006 [Compatibility::PerlMinimumVersionAndWhy] ((no explanation)) even when the first line of code in the file is use Modern::Perl '2014'; I agree, the year specification stuff seems a bit daft. I think I would just make all minimum version rules turn themselves off for any 'Modern::Perl' declaration, whatever the year. The tendency in recent perl releases has been for new features to only be enabled when a new enough perl version is declared - so there is less risk of accidentally using new perl features without a version requirement.
Subject: Re: [rt.cpan.org #100290] Recognize Modern::Perl
Date: Sat, 07 Mar 2015 19:18:30 +1100
To: "EDAVIS via RT" <bug-Perl-Critic-Pulp [...] rt.cpan.org>
From: Kevin Ryde <user42_kevin [...] yahoo.com.au>
"EDAVIS via RT" <bug-Perl-Critic-Pulp@rt.cpan.org> writes: Show quoted text
> > ./job:9:1:_perl_5006_pragmas requires 5.006 [Compatibility::PerlMinimumVersionAndWhy] ((no explanation))
Thanks. I wrote a bit and then never hooked it in. Version 90 should be better. Show quoted text
> I agree, the year specification stuff seems a bit daft. I think I > would just make all minimum version rules turn themselves off for any > 'Modern::Perl' declaration, whatever the year.
That's an idea. If Modern::Perl is a moving target anyway then I suppose there's no minimum perl compatibility to think about at all.
I've left it as meaning 5.10 for now, though if it gives some code interface for interpreting its years etc (and if anyone uses that feature :-) then maybe could follow that in the future.