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: 43457
Status: open
Priority: 0/
Queue: Perl-Critic

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

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



Subject: Recognize 'Modern::Perl'
MIME-Version: 1.0
X-Mailer: MIME-tools 5.427 (Entity 5.427)
Content-Type: text/plain
Charset: utf8
Content-Disposition: inline
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
Content-Length: 303
Download (untitled) / with headers
text/plain 303b
The module Modern::Perl packages up several 'best practice' options into one line. You can just say use Modern::Perl; and it turns on warnings, strict, 5.010, and C3 method resolution. The policies RequireUseStrict and RequireUseWarnings should recognize that Modern::Perl turns on these options.
MIME-Version: 1.0
X-Mailer: MIME-tools 5.427 (Entity 5.427)
Content-Disposition: inline
Charset: utf8
Content-Type: text/plain
Message-ID: <rt-3.6.HEAD-29719-1235130128-1793.43457-0-0 [...] rt.cpan.org>
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
Content-Length: 4068
Download (untitled) / with headers
text/plain 3.9k
Here's a patch: Index: Perl-Critic/t/TestingAndDebugging/RequireUseStrict.run =================================================================== --- Perl-Critic/t/TestingAndDebugging/RequireUseStrict.run (revision 3148) +++ Perl-Critic/t/TestingAndDebugging/RequireUseStrict.run (working copy) @@ -154,6 +154,15 @@ #----------------------------------------------------------------------------- +## name Modern::Perl support +## failures 0 +## cut + +use Modern::Perl; +$foo = $bar; + +#----------------------------------------------------------------------------- + ## name equivalent_modules ## failures 0 ## parms { equivalent_modules => 'Foo' } Index: Perl-Critic/t/TestingAndDebugging/RequireUseWarnings.run =================================================================== --- Perl-Critic/t/TestingAndDebugging/RequireUseWarnings.run (revision 3148) +++ Perl-Critic/t/TestingAndDebugging/RequireUseWarnings.run (working copy) @@ -188,6 +188,15 @@ #----------------------------------------------------------------------------- +## name Modern::Perl support +## failures 0 +## cut + +use Modern::Perl; +$foo = $bar; + +#----------------------------------------------------------------------------- + ## name equivalent_modules ## failures 0 ## parms { equivalent_modules => 'Foo' } Index: Perl-Critic/lib/Perl/Critic/Policy/TestingAndDebugging/RequireUseStrict.pm =================================================================== --- Perl-Critic/lib/Perl/Critic/Policy/TestingAndDebugging/RequireUseStrict.pm (revision 3148) +++ Perl-Critic/lib/Perl/Critic/Policy/TestingAndDebugging/RequireUseStrict.pm (working copy) @@ -33,7 +33,7 @@ default_string => $EMPTY, behavior => 'string list', list_always_present_values => - [ qw< strict Moose Moose::Role Moose::Util::TypeConstraints > ], + [ qw< strict Moose Moose::Role Moose::Util::TypeConstraints Modern::Perl > ], }, ); } @@ -134,10 +134,10 @@ code in the entire package will be affected. There are special exemptions for L<Moose|Moose>, -L<Moose::Role|Moose::Role>, and -L<Moose::Util::TypeConstraints|Moose::Util::TypeConstraints> because -they enforces strictness; e.g. C<'use Moose'> is treated as -equivalent to C<'use strict'>. +L<Moose::Role|Moose::Role>, +L<Moose::Util::TypeConstraints|Moose::Util::TypeConstraints>, +and L<Modern::Perl|Modern::Perl> because they enforce strictness; +e.g. C<'use Moose'> is treated as equivalent to C<'use strict'>. The maximum number of violations per document for this policy defaults to 1. Index: Perl-Critic/lib/Perl/Critic/Policy/TestingAndDebugging/RequireUseWarnings.pm =================================================================== --- Perl-Critic/lib/Perl/Critic/Policy/TestingAndDebugging/RequireUseWarnings.pm (revision 3148) +++ Perl-Critic/lib/Perl/Critic/Policy/TestingAndDebugging/RequireUseWarnings.pm (working copy) @@ -38,7 +38,7 @@ default_string => $EMPTY, behavior => 'string list', list_always_present_values => - [ qw< warnings Moose Moose::Role Moose::Util::TypeConstraints > ], + [ qw< warnings Moose Moose::Role Moose::Util::TypeConstraints Modern::Perl > ], }, ); } @@ -142,11 +142,10 @@ statements. Thus, all the code in the entire package will be affected. -There are special exemptions for L<Moose|Moose>, -L<Moose::Role|Moose::Role>, and -L<Moose::Util::TypeConstraints|Moose::Util::TypeConstraints> because -they enforces warnings; e.g. C<'use Moose'> is treated as -equivalent to C<'use warnings'>. +There are special exemptions for L<Moose|Moose>, L<Moose::Role|Moose::Role>, +L<Moose::Util::TypeConstraints|Moose::Util::TypeConstraints>, and +L<Modern::Perl|Modern::Perl> because they enforce warnings; e.g. +C<'use Moose'> is treated as equivalent to C<'use warnings'>. This policy will not complain if the file explicitly states that it is compatible with a version of perl prior to 5.6 via an include
MIME-Version: 1.0
In-Reply-To: <rt-3.6.HEAD-29719-1235130128-1793.43457-0-0 [...] rt.cpan.org>
X-Mailer: MIME-tools 5.427 (Entity 5.427)
Content-Disposition: inline
Charset: utf8
References: <rt-3.6.HEAD-29719-1235130128-1793.43457-0-0 [...] rt.cpan.org>
Content-Type: text/plain
Message-ID: <rt-3.6.HEAD-25907-1237215303-1302.43457-0-0 [...] rt.cpan.org>
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
Content-Length: 84
The patch still applies cleanly against 1.098. Would you consider it for inclusion?
MIME-Version: 1.0
X-Spam-Status: No, hits=-0.0 required=8.0 tests=SPF_PASS
In-Reply-To: <rt-3.6.HEAD-25907-1237215303-1302.43457-5-0 [...] rt.cpan.org>
References: <RT-Ticket-43457 [...] rt.cpan.org> <rt-3.6.HEAD-29719-1235130128-1793.43457-5-0 [...] rt.cpan.org> <rt-3.6.HEAD-25907-1237215303-1302.43457-5-0 [...] rt.cpan.org>
Message-ID: <49BEF459.8070806 [...] galumph.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
X-RT-Original-Encoding: utf-8
Received: from la.mx.develooper.com (x1.develooper.com [63.251.223.170]) by diesel.bestpractical.com (Postfix) with SMTP id 9491523C103 for <bug-Perl-Critic [...] rt.cpan.org>; Mon, 16 Mar 2009 20:52:49 -0400 (EDT)
Received: (qmail 12271 invoked by uid 103); 17 Mar 2009 00:52:48 -0000
Received: from x16.dev (10.0.100.26) by x1.dev with QMQP; 17 Mar 2009 00:52:48 -0000
Received: from pendrell.textdrive.com (HELO pendrell.textdrive.com) (207.7.108.149) by 16.mx.develooper.com (qpsmtpd/0.43rc1) with ESMTP; Mon, 16 Mar 2009 17:52:47 -0700
Received: from emdaer.local (adsl-69-209-217-185.dsl.chcgil.sbcglobal.net [69.209.217.185]) by pendrell.textdrive.com (Postfix) with ESMTP id E534BBB1E9 for <bug-Perl-Critic [...] rt.cpan.org>; Tue, 17 Mar 2009 00:52:42 +0000 (GMT)
Delivered-To: cpan-bug+Perl-Critic [...] diesel.bestpractical.com
Subject: Re: [rt.cpan.org #43457] Recognize 'Modern::Perl'
User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en-US; rv:1.8.1.19) Gecko/20081209 Thunderbird/2.0.0.19 Mnenhy/0.7.5.0
Return-Path: <perl [...] galumph.com>
X-Spam-Check-BY: 16.mx.develooper.com
X-Original-To: bug-Perl-Critic [...] rt.cpan.org
Date: Mon, 16 Mar 2009 19:52:41 -0500
X-Spam-Level: *
To: bug-Perl-Critic [...] rt.cpan.org
Content-Transfer-Encoding: 7bit
From: Elliot Shank <perl [...] galumph.com>
RT-Message-ID: <rt-3.6.HEAD-25907-1237251175-673.43457-0-0 [...] rt.cpan.org>
Content-Length: 389
Download (untitled) / with headers
text/plain 389b
EDAVIS via RT wrote: Show quoted text
> The patch still applies cleanly against 1.098. Would you consider it > for inclusion?
I think we're done with adding modules to the defaults. Use the equivalent_modules option for both of these policies. In regards to Modern::Perl specifically, I don't think chromatic has addressed what happens when 5.12 comes around. Does he suddenly break all of your code?
MIME-Version: 1.0
In-Reply-To: <rt-3.6.HEAD-25907-1237251175-673.43457-0-0 [...] rt.cpan.org>
X-Mailer: MIME-tools 5.427 (Entity 5.427)
Content-Disposition: inline
Charset: utf8
References: <RT-Ticket-43457 [...] rt.cpan.org> <rt-3.6.HEAD-29719-1235130128-1793.43457-5-0 [...] rt.cpan.org> <rt-3.6.HEAD-25907-1237215303-1302.43457-5-0 [...] rt.cpan.org> <49BEF459.8070806 [...] galumph.com> <rt-3.6.HEAD-25907-1237251175-673.43457-0-0 [...] rt.cpan.org>
Content-Type: text/plain
Message-ID: <rt-3.6.HEAD-2203-1237983882-1036.43457-0-0 [...] rt.cpan.org>
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
Content-Length: 1289
Download (untitled) / with headers
text/plain 1.2k
On Mon Mar 16 20:52:55 2009, clonezone wrote: Show quoted text
> EDAVIS via RT wrote:
> > The patch still applies cleanly against 1.098. Would you consider
> it
> > for inclusion?
> > I think we're done with adding modules to the defaults. Use the > equivalent_modules option for both of these policies.
This is a rather arbitrary decision; so a relatively obscure module like Moose::Util::TypeConstraints that turns on strict almost as a side effect is accepted, but Modern::Perl (whose very raison d'etre is to turn on strict and warnings) is not. I appreciate that having a list of modules in the perlcritic code is not the most scalable way of doing it, but if you do have that, there is no reason to exclude some modules and include others just on the basis they were there first. Show quoted text
>In regards to Modern::Perl specifically, I don't think chromatic has >addressed what happens when 5.12 comes around. Does he suddenly break >all of your code?
I don't know about that, but I don't think perlcritic should pick winners and losers in this way. Perhaps a more reasonable way to resolve this would be for Modern::Perl (and other modules in the same spirit) to have some kind of marker which is noticed by perlcritic. Then there would be no need for the default configuration to have a list of them.
MIME-Version: 1.0 (Apple Message framework v930.3)
X-Spam-Status: No, hits=-4.0 required=8.0 tests=RCVD_IN_DNSWL_MED
In-Reply-To: <rt-3.6.HEAD-2203-1237983882-1036.43457-5-0 [...] rt.cpan.org>
X-Mailer: Apple Mail (2.930.3)
References: <RT-Ticket-43457 [...] rt.cpan.org> <rt-3.6.HEAD-29719-1235130128-1793.43457-5-0 [...] rt.cpan.org> <rt-3.6.HEAD-25907-1237215303-1302.43457-5-0 [...] rt.cpan.org> <49BEF459.8070806 [...] galumph.com> <rt-3.6.HEAD-25907-1237251175-673.43457-5-0 [...] rt.cpan.org> <rt-3.6.HEAD-2203-1237983882-1036.43457-5-0 [...] rt.cpan.org>
Message-ID: <AD60A9B2-A4F3-4439-AE23-97A0B13288F7 [...] imaginative-software.com>
Content-Type: text/plain; charset="utf-8"; delsp="yes"; format="flowed"
X-RT-Original-Encoding: utf-8
Received: from la.mx.develooper.com (x1.develooper.com [207.171.7.70]) by diesel.bestpractical.com (Postfix) with SMTP id D8E1423C110 for <bug-Perl-Critic [...] rt.cpan.org>; Wed, 25 Mar 2009 18:07:01 -0400 (EDT)
Received: (qmail 29985 invoked by uid 103); 25 Mar 2009 22:07:01 -0000
Received: from x16.dev (10.0.100.26) by x1.dev with QMQP; 25 Mar 2009 22:07:01 -0000
Received: from mail-out3.apple.com (HELO mail-out3.apple.com) (17.254.13.22) by 16.mx.develooper.com (qpsmtpd/0.80) with ESMTP; Wed, 25 Mar 2009 15:06:58 -0700
Received: from relay11.apple.com (relay11.apple.com [17.128.113.48]) by mail-out3.apple.com (Postfix) with ESMTP id 3057158D6DD8 for <bug-Perl-Critic [...] rt.cpan.org>; Wed, 25 Mar 2009 15:06:56 -0700 (PDT)
Received: from relay11.apple.com (unknown [127.0.0.1]) by relay11.apple.com (Symantec Brightmail Gateway) with ESMTP id 187BC2807F for <bug-Perl-Critic [...] rt.cpan.org>; Wed, 25 Mar 2009 15:06:56 -0700 (PDT)
Received: from vp0102wa-dhcp57.apple.com (vp0102wa-dhcp57.apple.com [17.224.39.57]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by relay11.apple.com (Apple SCV relay) with ESMTP id F416828080 for <bug-Perl-Critic [...] rt.cpan.org>; Wed, 25 Mar 2009 15:06:55 -0700 (PDT)
Delivered-To: cpan-bug+Perl-Critic [...] diesel.bestpractical.com
Subject: Re: [rt.cpan.org #43457] Recognize 'Modern::Perl'
X-Auditid: 11807130-aa094bb000000fcd-4d-49caaaff3086
Return-Path: <jeff [...] imaginative-software.com>
X-Spam-Check-BY: 16.mx.develooper.com
X-Original-To: bug-Perl-Critic [...] rt.cpan.org
X-Brightmail-Tracker: AAAAAA==
Date: Wed, 25 Mar 2009 15:06:55 -0700
X-Spam-Level: *
To: bug-Perl-Critic [...] rt.cpan.org
Content-Transfer-Encoding: 7bit
From: Jeffrey Thalhammer <jeff [...] imaginative-software.com>
RT-Message-ID: <rt-3.6.HEAD-2203-1238018828-905.43457-0-0 [...] rt.cpan.org>
Content-Length: 992
Download (untitled) / with headers
text/plain 992b
Show quoted text
>>> The patch still applies cleanly against 1.098. Would you consider >>> it >>> for inclusion?
>> >> I think we're done with adding modules to the defaults. Use the >> equivalent_modules option for both of these policies.
> > This is a rather arbitrary decision; so a relatively obscure module > like > Moose::Util::TypeConstraints that turns on strict almost as a side > effect is accepted, but Modern::Perl (whose very raison d'etre is to > turn on strict and warnings) is not. > > I appreciate that having a list of modules in the perlcritic code is > not > the most scalable way of doing it, but if you do have that, there is > no > reason to exclude some modules and include others just on the basis > they > were there first.
I tend to agree with Ed on this. But since the list is user- configurable, please understand that this isn't a high priority. I really appreciate the patch, and we'll apply it as soon as this issue comes up in the queue. Thanks. -Jeff
MIME-Version: 1.0
X-Spam-Status: No, hits=-0.0 required=8.0 tests=SPF_PASS
In-Reply-To: <rt-3.6.HEAD-2203-1237983882-1036.43457-5-0 [...] rt.cpan.org>
References: <RT-Ticket-43457 [...] rt.cpan.org> <rt-3.6.HEAD-29719-1235130128-1793.43457-5-0 [...] rt.cpan.org> <rt-3.6.HEAD-25907-1237215303-1302.43457-5-0 [...] rt.cpan.org> <49BEF459.8070806 [...] galumph.com> <rt-3.6.HEAD-25907-1237251175-673.43457-5-0 [...] rt.cpan.org> <rt-3.6.HEAD-2203-1237983882-1036.43457-5-0 [...] rt.cpan.org>
Message-ID: <4A105D80.6080905 [...] galumph.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
X-RT-Original-Encoding: utf-8
Received: from la.mx.develooper.com (x1.develooper.com [207.171.7.70]) by diesel.bestpractical.com (Postfix) with SMTP id 9F8C519B824A for <bug-Perl-Critic [...] rt.cpan.org>; Sun, 17 May 2009 14:55:34 -0400 (EDT)
Received: (qmail 31218 invoked by uid 103); 17 May 2009 18:55:33 -0000
Received: from x16.dev (10.0.100.26) by x1.dev with QMQP; 17 May 2009 18:55:33 -0000
Received: from pendrell.textdrive.com (HELO pendrell.textdrive.com) (207.7.108.149) by 16.mx.develooper.com (qpsmtpd/0.80) with ESMTP; Sun, 17 May 2009 11:55:28 -0700
Received: from emdaer.local (adsl-75-22-197-226.dsl.chcgil.sbcglobal.net [75.22.197.226]) by pendrell.textdrive.com (Postfix) with ESMTP id 8971FBB317 for <bug-Perl-Critic [...] rt.cpan.org>; Sun, 17 May 2009 18:54:59 +0000 (GMT)
Delivered-To: cpan-bug+Perl-Critic [...] diesel.bestpractical.com
Subject: Re: [rt.cpan.org #43457] Recognize 'Modern::Perl'
User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en-US; rv:1.8.1.21) Gecko/20090302 Thunderbird/2.0.0.21 Mnenhy/0.7.5.0
Return-Path: <perl [...] galumph.com>
X-Spam-Check-BY: 16.mx.develooper.com
X-Original-To: bug-Perl-Critic [...] rt.cpan.org
Date: Sun, 17 May 2009 13:54:56 -0500
X-Spam-Level: *
To: bug-Perl-Critic [...] rt.cpan.org
Content-Transfer-Encoding: 7bit
From: Elliot Shank <perl [...] galumph.com>
RT-Message-ID: <rt-3.6.HEAD-2324-1242586543-867.43457-0-0 [...] rt.cpan.org>
Content-Length: 765
Download (untitled) / with headers
text/plain 765b
EDAVIS via RT wrote: Show quoted text
> On Mon Mar 16 20:52:55 2009, clonezone wrote:
>> EDAVIS via RT wrote:
>>> The patch still applies cleanly against 1.098. Would you >>> consider it for inclusion?
>> >> I think we're done with adding modules to the defaults. Use the >> equivalent_modules option for both of these policies.
> > This is a rather arbitrary decision; so a relatively obscure module > like Moose::Util::TypeConstraints that turns on strict almost as a > side effect is accepted, but Modern::Perl (whose very raison d'etre > is to turn on strict and warnings) is not.
If you use Moose, Moose::Util::TypeConstraints shouldn't be obscure. In regards to Modern::Perl, I wrote a blog post: http://elliotlovesperl.com/2009/05/17/the-problem-with-modernperl/.
MIME-Version: 1.0
In-Reply-To: <rt-3.6.HEAD-2324-1242586543-867.43457-0-0 [...] rt.cpan.org>
X-Mailer: MIME-tools 5.427 (Entity 5.427)
Content-Disposition: inline
References: <RT-Ticket-43457 [...] rt.cpan.org> <rt-3.6.HEAD-29719-1235130128-1793.43457-5-0 [...] rt.cpan.org> <rt-3.6.HEAD-25907-1237215303-1302.43457-5-0 [...] rt.cpan.org> <49BEF459.8070806 [...] galumph.com> <rt-3.6.HEAD-25907-1237251175-673.43457-5-0 [...] rt.cpan.org> <rt-3.6.HEAD-2203-1237983882-1036.43457-5-0 [...] rt.cpan.org> <4A105D80.6080905 [...] galumph.com> <rt-3.6.HEAD-2324-1242586543-867.43457-0-0 [...] rt.cpan.org>
Content-Type: text/plain; charset="UTF-8"
Message-ID: <rt-3.8.HEAD-29489-1286426979-871.43457-0-0 [...] rt.cpan.org>
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
Content-Length: 1296
Download (untitled) / with headers
text/plain 1.2k
Show quoted text
> In regards to Modern::Perl, I wrote a blog post: > http://elliotlovesperl.com/2009/05/17/the-problem-with-modernperl/.
I'm not sure what is more lame, your rational, or your twitter-like blog without comments... Your argument isn't addressing chromatic's module, it is addressing the word "Modern", and the nature of referencing the future in the present. Modern::Perl, like my nextgen.pm, is supposed to move with perl. I should remind you this is how *most* software works, and ironically even though perl has 'features', it works like this to: between perl 5.10.0, and 5.10.1, we know that Perl 5.10's misimplimentation of smart match is what is responsible for breaking code -- not Chromatic's module. Even without 'features' just the binary makes all of your code fundamentally incompatible -- and it is only a minor point release. By any means, not upgrading Perl Critic because you want to make a political statement about Modern::Perl is lame. Even more lame than your almost wholly deceptive statement about Moose::Util::TypeConstraints (which is almost totally deprecated with the much improved MooseX::Types). Found via open bug on Modern::Perl: https://rt.cpan.org/Ticket/Display.html?id=47568 -- Evan Carroll System Lord of the Internets http://www.evancarroll.com


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.