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

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

Bug Information
Severity: Normal
Broken in:
  • 1.111
  • 1.112_001
Fixed in:
  • 1.112_002
  • 1.113



CC: ADAMK [...] cpan.org
Subject: PPI 1.214_0? breaks Perl::Critic
As per subject. CC'd to Adam. I don't know whether PPI or P:C need fixing. Both Perl-Critic 1.111 and 1.112_001 are affected in t/20_policies.t # Failed test 'Subroutines::RequireArgUnpacking - line 233 - but catch @$_[0] outside of a postfix for loop' # at t/20_policies.t line 27. # Expected 1 violations, got 0. # Looks like you failed 1 test of 2642. HTH, Cheers,
RT-Send-CC: ADAMK [...] cpan.org
On Tue Feb 01 02:51:35 2011, ANDK wrote: Show quoted text
> As per subject. > > CC'd to Adam. I don't know whether PPI or P:C need fixing. > > Both Perl-Critic 1.111 and 1.112_001 are affected in t/20_policies.t > > # Failed test 'Subroutines::RequireArgUnpacking - line 233 - but catch > @$_[0] outside of a postfix for loop' > # at t/20_policies.t line 27. > # Expected 1 violations, got 0. > # Looks like you failed 1 test of 2642. > > HTH, Cheers,
Thank you for the report. My read on this is that it is a bad test exposed by a change in PPI. But I was involved in the PPI change, so I would appreciate other eyes on the test, since if I'm wrong I committed a bad change to PPI. The test appears to assume that @$_[0] makes use of @_. But when I try it it appears to make use of $_. At least, when I execute sub my_sub { my @a = ( [ 1, 2 ], [ 3, 4 ] ); for (@a){ print @$_[0], "\n"; } print @$_[0], "\n"; } $_ = [ qw{ uno dos tres cuatro } ]; my_sub([ 'I', 'II' ], [ 'III', 'IV' ]); which is a gussied up version of the failing test, it prints 13 uno rather than 13 IIII as I might expect if @$_[0] accessed @_. The PPI connection is https://rt.cpan.org/Ticket/Display.html?id=65199 which patches the PPI::Token::Symbol->symbol() method. This ticket addresses the fact that $$a[0] is actually $a->[0], not ${$a[0]}, and therefore symbol() should return '$a', not '@a' as it was formerly doing. The SVN commit also addressed the case of @$a[0] as being '$a', per the above analysis, though I was silent about that in the RT ticket. Bottom line: if my analysis is right, this is a bad test. If I'm wrong, I need to fix my PPI change. Tom
I await your instructions on what I need to do in regards to this, just let me know
RT-Send-CC: ADAMK [...] cpan.org
On Tue Feb 01 19:21:06 2011, ADAMK wrote: Show quoted text
> I await your instructions on what I need to do in regards to this, just > let me know
Can you hang loose until Monday? I've made my argument that it's a bad test in Perl::Critic. If nobody makes a counter-argument by then, I'm calling it that way. I'd call it now, but slices of references are not in my day-to-day Perl vocabulary.
CC: ADAMK [...] cpan.org
Subject: Re: [rt.cpan.org #65322] PPI 1.214_0? breaks Perl::Critic
Date: Thu, 3 Feb 2011 10:29:25 +1100
To: bug-Perl-Critic [...] rt.cpan.org
From: Adam Kennedy <adamkennedybackup [...] gmail.com>
I'm in no rush to do a prod release if my biggest userbase isn't happy. We pretty much always co-ordinate the two releases. Adam K On 3 February 2011 04:25, Tom Wyant via RT <bug-Perl-Critic@rt.cpan.org> wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=65322 > > > On Tue Feb 01 19:21:06 2011, ADAMK wrote:
>> I await your instructions on what I need to do in regards to this, just >> let me know
> > Can you hang loose until Monday? I've made my argument that it's a bad > test in Perl::Critic. If nobody makes a counter-argument by then, I'm > calling it that way. I'd call it now, but slices of references are not > in my day-to-day Perl vocabulary. >
Subject: Re: [rt.cpan.org #65322] PPI 1.214_0? breaks Perl::Critic
Date: Wed, 02 Feb 2011 18:28:46 -0600
To: bug-Perl-Critic [...] rt.cpan.org
From: Elliot Shank <perl [...] galumph.com>
On 2/1/11 11:11 AM, Tom Wyant via RT wrote: Show quoted text
> Bottom line: if my analysis is right, this is a bad test. If I'm wrong, > I need to fix my PPI change.
I concur that this is a bad test. The code under test is ugly, but it doesn't violate the Policy. It's a follow-on from the prior test, which is a test for https://rt.cpan.org/Public/Bug/Display.html?id=39601 Really, it doesn't matter where "@$_..." is, it isn't a violation.
RT-Send-CC: ADAMK [...] cpan.org, perl [...] galumph.com
On Wed Feb 02 19:28:59 2011, clonezone wrote: Show quoted text
> On 2/1/11 11:11 AM, Tom Wyant via RT wrote:
> > Bottom line: if my analysis is right, this is a bad test. If I'm
> wrong,
> > I need to fix my PPI change.
> > I concur that this is a bad test. The code under test is ugly, but it > doesn't violate the Policy. It's a follow-on from the prior test, > which is a test for > https://rt.cpan.org/Public/Bug/Display.html?id=39601 Really, it > doesn't matter where "@$_..." is, it isn't a violation.
Thanks Elliot. Since it was my code that exposed this, I appreciate the second pair of eyes. The test is removed as of SVN revision 4027. And this is _not_ a PPI issue. Tom