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

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

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



From gg [...] zip.com.au Wed Jul 7 17: 47:37 2010
MIME-Version: 1.0
X-Spam-Status: No, score=-10.571 tagged_above=-99.9 required=10 tests=[AWL=0.028, BAYES_00=-2.599, RCVD_IN_DNSWL_HI=-8] autolearn=ham
X-Spam-Flag: NO
content-type: text/plain; charset="utf-8"
Message-ID: <87iq4rc69v.fsf [...] blah.blah>
X-Virus-Scanned: Debian amavisd-new at bestpractical.com
X-Spam-Score: -10.571
Received: from localhost (localhost [127.0.0.1]) by hipster.bestpractical.com (Postfix) with ESMTP id 6C05261E00E for <cpan-bug+Perl-Critic [...] hipster.bestpractical.com>; Wed, 7 Jul 2010 17:47:37 -0400 (EDT)
Received: from hipster.bestpractical.com ([127.0.0.1]) by localhost (hipster.bestpractical.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id DKliVF7j8avC for <cpan-bug+Perl-Critic [...] hipster.bestpractical.com>; Wed, 7 Jul 2010 17:47:35 -0400 (EDT)
Received: from la.mx.develooper.com (x1.develooper.com [207.171.7.70]) by hipster.bestpractical.com (Postfix) with SMTP id 1130061E00C for <bug-Perl-Critic [...] rt.cpan.org>; Wed, 7 Jul 2010 17:47:34 -0400 (EDT)
Received: (qmail 30558 invoked by uid 103); 7 Jul 2010 21:49:04 -0000
Received: from x16.dev (10.0.100.26) by x1.dev with QMQP; 7 Jul 2010 21:49:04 -0000
Received: from mailout2-6.pacific.net.au (HELO mailout2.pacific.net.au) (61.8.2.229) by 16.mx.develooper.com (qpsmtpd/0.80) with ESMTP; Wed, 07 Jul 2010 14:49:02 -0700
Received: from mailproxy2.pacific.net.au (mailproxy2.pacific.net.au [61.8.2.163]) by mailout2.pacific.net.au (Postfix) with ESMTP id C6E09222DBC for <bug-Perl-Critic [...] rt.cpan.org>; Thu, 8 Jul 2010 07:48:58 +1000 (EST)
Received: from blah.blah (ppp2EFE.dyn.pacific.net.au [61.8.46.254]) by mailproxy2.pacific.net.au (Postfix) with ESMTP id 5BCA32740C for <bug-Perl-Critic [...] rt.cpan.org>; Thu, 8 Jul 2010 07:48:58 +1000 (EST)
Received: from gg by blah.blah with local (Exim 4.72) (envelope-from <gg [...] zip.com.au>) id 1OWcU0-0003we-Ac for bug-Perl-Critic [...] rt.cpan.org; Thu, 08 Jul 2010 07:48:44 +1000
Delivered-To: cpan-bug+Perl-Critic [...] hipster.bestpractical.com
User-Agent: Gnus/5.110011 (No Gnus v0.11) Emacs/23.2 (gnu/linux)
Subject: policy object violation() method called in different package
Return-Path: <gg [...] zip.com.au>
X-RT-Mail-Extension: perl-critic
X-Original-To: cpan-bug+Perl-Critic [...] hipster.bestpractical.com
X-Spam-Check-BY: 16.mx.develooper.com
Date: Thu, 08 Jul 2010 07:48:44 +1000
X-Spam-Level:
To: bug-Perl-Critic [...] rt.cpan.org
From: Kevin Ryde <user42 [...] zip.com.au>
X-RT-Original-Encoding: us-ascii
Content-Length: 412
Download (untitled) / with headers
text/plain 412b
I created a violation object with $policy->violation from within a helper utilities package and found the resulting $violation object had its $violation->policy coming back as the utilities package, not the originating policy object's class. I see there's stuff in Perl::Critic::Violation->new using the caller package, but I hoped that $policy->violation on a policy object would not be afflicted by that :-).
From perl [...] galumph.com Sun Oct 24 14: 18:10 2010
MIME-Version: 1.0
X-Spam-Status: No, score=-8.017 tagged_above=-99.9 required=10 tests=[AWL=-1.896, BAYES_00=-1.9, RCVD_IN_DNSWL_HI=-5, SPF_NEUTRAL=0.779] autolearn=ham
In-Reply-To: <rt-3.8.HEAD-2369-1278539350-1083.59175-4-0 [...] rt.cpan.org>
X-Spam-Flag: NO
References: <RT-Ticket-59175 [...] rt.cpan.org> <87iq4rc69v.fsf [...] blah.blah> <rt-3.8.HEAD-2369-1278539350-1083.59175-4-0 [...] rt.cpan.org>
X-Virus-Scanned: Debian amavisd-new at bestpractical.com
Message-ID: <4CC4785E.2070805 [...] galumph.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
X-RT-Original-Encoding: utf-8
X-Spam-Score: -8.017
Received: from localhost (localhost [127.0.0.1]) by hipster.bestpractical.com (Postfix) with ESMTP id 39D8E240ECC for <cpan-bug+Perl-Critic [...] hipster.bestpractical.com>; Sun, 24 Oct 2010 14:18:10 -0400 (EDT)
Received: from hipster.bestpractical.com ([127.0.0.1]) by localhost (hipster.bestpractical.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 2qERuE3HV5k1 for <cpan-bug+Perl-Critic [...] hipster.bestpractical.com>; Sun, 24 Oct 2010 14:18:08 -0400 (EDT)
Received: from la.mx.develooper.com (x1.develooper.com [207.171.7.70]) by hipster.bestpractical.com (Postfix) with SMTP id 111EF240EC2 for <bug-Perl-Critic [...] rt.cpan.org>; Sun, 24 Oct 2010 14:18:07 -0400 (EDT)
Received: (qmail 29491 invoked by uid 103); 24 Oct 2010 18:18:16 -0000
Received: from x16.dev (10.0.100.26) by x1.dev with QMQP; 24 Oct 2010 18:18:16 -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, 24 Oct 2010 11:18:14 -0700
Received: from emdaer.local (unknown [71.23.164.198]) by pendrell.textdrive.com (Postfix) with ESMTP id B78A5C0BCC for <bug-Perl-Critic [...] rt.cpan.org>; Sun, 24 Oct 2010 18:18:11 +0000 (GMT)
Delivered-To: cpan-bug+Perl-Critic [...] hipster.bestpractical.com
User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en-US; rv:1.8.1.22) Gecko/20090605 Thunderbird/2.0.0.22 Mnenhy/0.7.5.0
Subject: Re: [rt.cpan.org #59175] policy object violation() method called in different package
Return-Path: <perl [...] galumph.com>
X-Spam-Check-BY: 16.mx.develooper.com
X-Original-To: cpan-bug+Perl-Critic [...] hipster.bestpractical.com
X-RT-Mail-Extension: perl-critic
Date: Sun, 24 Oct 2010 13:18:06 -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.8.HEAD-2361-1287944300-718.59175-0-0 [...] rt.cpan.org>
Content-Length: 230
Download (untitled) / with headers
text/plain 230b
Yeah, the problem here is that it was originally intended for Policies to call the constructor directly, so that hack was put in. We should probably deprecate that and switch to a _new() method that does things without the hack.
MIME-Version: 1.0
In-Reply-To: <rt-3.8.HEAD-2361-1287944300-718.59175-0-0 [...] rt.cpan.org>
X-Mailer: MIME-tools 5.427 (Entity 5.427)
Content-Disposition: inline
References: <RT-Ticket-59175 [...] rt.cpan.org> <87iq4rc69v.fsf [...] blah.blah> <rt-3.8.HEAD-2369-1278539350-1083.59175-4-0 [...] rt.cpan.org> <4CC4785E.2070805 [...] galumph.com> <rt-3.8.HEAD-2361-1287944300-718.59175-0-0 [...] rt.cpan.org>
Content-Type: text/plain; charset="UTF-8"
Message-ID: <rt-3.8.HEAD-2361-1287957503-1668.59175-0-0 [...] rt.cpan.org>
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
Content-Length: 1600
Download (untitled) / with headers
text/plain 1.5k
On Sun Oct 24 14:18:20 2010, clonezone wrote: Show quoted text
> Yeah, the problem here is that it was originally intended for Policies > to call the constructor directly, so that hack was put in. We > should probably deprecate that and switch to a _new() method that > does things without the hack.
Jeff and I have been kicking around named arguments for Perl::Critic::Violation->new(). It's easy to disambiguate a valid named call from a positional call because the former has at least 9 arguments (counting the invocant), but the latter only has 5, and the 5 is enforced by a throw_internal(). The Perl::Critic::Policy violation() method would use the named interface and pass a -policy argument, which would provide both the policy name (providing a response to this ticket, I think) and the severity. This eliminates the caller() hack. Because the P::C::P violation() method does _not_ validate its number of arguments, the plan is to create P::C::P make_violation(), which takes named arguments. All of this is in branch violation_named_args, where it will remain until _after_ the next release, unless you say otherwise. The incentive was actually another of Kevin's tickets, which asks for better reported line and column numbers for POD errors. The envisioned change here was to add arguments to the P::C::Violation() instantiator to allow tweaking of the position reported by PPI. The implementation is undefined. I am currently leaning away from fiddling with the position reported by PPI, because of the possibility of changing which Perl::Critic annotation (if any) applies to the element.
From gg [...] zip.com.au Thu Oct 28 23: 02:25 2010
MIME-Version: 1.0
X-Spam-Status: No, score=-8.598 tagged_above=-99.9 required=10 tests=[AWL=-1.698, BAYES_00=-1.9, RCVD_IN_DNSWL_HI=-5] autolearn=ham
In-Reply-To: <rt-3.8.HEAD-2361-1287957503-1076.59175-6-0 [...] rt.cpan.org> (Tom Wyant via's message of "Sun, 24 Oct 2010 17:58:24 -0400")
X-Spam-Flag: NO
References: <RT-Ticket-59175 [...] rt.cpan.org> <87iq4rc69v.fsf [...] blah.blah> <rt-3.8.HEAD-2369-1278539350-1083.59175-4-0 [...] rt.cpan.org> <4CC4785E.2070805 [...] galumph.com> <rt-3.8.HEAD-2361-1287944300-718.59175-6-0 [...] rt.cpan.org> <rt-3.8.HEAD-2361-1287957503-1076.59175-6-0 [...] rt.cpan.org>
X-Virus-Scanned: Debian amavisd-new at bestpractical.com
Message-ID: <87iq0l2a6l.fsf [...] blah.blah>
Content-Type: text/plain; charset="utf-8"
X-RT-Original-Encoding: utf-8
X-Spam-Score: -8.598
Received: from localhost (localhost [127.0.0.1]) by hipster.bestpractical.com (Postfix) with ESMTP id 938C3240EEF for <cpan-bug+Perl-Critic [...] hipster.bestpractical.com>; Thu, 28 Oct 2010 23:02:25 -0400 (EDT)
Received: from hipster.bestpractical.com ([127.0.0.1]) by localhost (hipster.bestpractical.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id VJ6AOGvsowXO for <cpan-bug+Perl-Critic [...] hipster.bestpractical.com>; Thu, 28 Oct 2010 23:02:23 -0400 (EDT)
Received: from la.mx.develooper.com (x1.develooper.com [207.171.7.70]) by hipster.bestpractical.com (Postfix) with SMTP id 1B1E8240ED3 for <bug-Perl-Critic [...] rt.cpan.org>; Thu, 28 Oct 2010 23:02:22 -0400 (EDT)
Received: (qmail 23457 invoked by uid 103); 28 Oct 2010 23:02:20 -0000
Received: from x16.dev (10.0.100.26) by x1.dev with QMQP; 28 Oct 2010 23:02:20 -0000
Received: from mailout2-5.pacific.net.au (HELO mailout2.pacific.net.au) (61.8.2.228) by 16.mx.develooper.com (qpsmtpd/0.80) with ESMTP; Thu, 28 Oct 2010 16:02:18 -0700
Received: from mailproxy2.pacific.net.au (mailproxy2.pacific.net.au [61.8.2.163]) by mailout2.pacific.net.au (Postfix) with ESMTP id 33CA32A5271 for <bug-Perl-Critic [...] rt.cpan.org>; Fri, 29 Oct 2010 10:02:14 +1100 (EST)
Received: from blah.blah (ppp2916.dyn.pacific.net.au [61.8.41.22]) by mailproxy2.pacific.net.au (Postfix) with ESMTP id 7614B27414 for <bug-Perl-Critic [...] rt.cpan.org>; Fri, 29 Oct 2010 10:02:13 +1100 (EST)
Received: from gg by blah.blah with local (Exim 4.72) (envelope-from <gg [...] zip.com.au>) id 1PBbU2-0004j4-0d for bug-Perl-Critic [...] rt.cpan.org; Fri, 29 Oct 2010 10:02:10 +1100
Delivered-To: cpan-bug+Perl-Critic [...] hipster.bestpractical.com
Subject: Re: [rt.cpan.org #59175] policy object violation() method called in different package
User-Agent: Gnus/5.110011 (No Gnus v0.11) Emacs/23.2 (gnu/linux)
Return-Path: <gg [...] zip.com.au>
X-Spam-Check-BY: 16.mx.develooper.com
X-Original-To: cpan-bug+Perl-Critic [...] hipster.bestpractical.com
X-RT-Mail-Extension: perl-critic
Date: Fri, 29 Oct 2010 10:02:10 +1100
X-Spam-Level:
To: bug-Perl-Critic [...] rt.cpan.org
From: Kevin Ryde <user42 [...] zip.com.au>
RT-Message-ID: <rt-3.8.HEAD-2360-1288321346-331.59175-0-0 [...] rt.cpan.org>
Content-Length: 963
Download (untitled) / with headers
text/plain 963b
"Tom Wyant via RT" <bug-Perl-Critic@rt.cpan.org> writes: Show quoted text
> > Jeff and I have been kicking around named arguments for > Perl::Critic::Violation->new(). It's easy to disambiguate a valid named > call from a positional call because the former has at least 9 arguments > (counting the invocant), but the latter only has 5, and the 5 is > enforced by a throw_internal().
That sounds a touch subtle. I'd think hard about chucking optional args on the end of the existing call, Perl::Critic::Violation->new($desc, $expl, $elem, $sev, policy => $packagename, offset => ...); The policy could default to the caller as now. Except for the extra $sev arg it could be the same as the $policy->violation(). I suppose also possible would be a one-arg hashref of key/value bits. Personally I think I normally prefer a list of args instead of a hashref, but a hashref might be unambiguous in this case.


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.