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

People
Owner: Nobody in particular
Requestors: buys444 [...] gmail.com
Cc:
AdminCc:

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



From lorkfudge [...] gmail.com Thu Jun 6 16: 20:29 2013
MIME-Version: 1.0
X-Spam-Status: No, score=-6.219 tagged_above=-99.9 required=10 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_HI=-5, SPF_NEUTRAL=0.779] autolearn=ham
X-Spam-Flag: NO
Content-Type: multipart/alternative; boundary="047d7b343e38dca0c204de820a14"
Message-ID: <CAKJxnop_fFcL1iZByjoAG8Esy7_pGEG8TS13OfhhLwoNgUqnDg [...] mail.gmail.com>
X-Received: by 10.14.202.71 with SMTP id c47mr36107125eeo.87.1370550016174; Thu, 06 Jun 2013 13:20:16 -0700 (PDT)
X-Virus-Scanned: Debian amavisd-new at bestpractical.com
X-Spam-Score: -6.219
Received: from localhost (localhost [127.0.0.1]) by hipster.bestpractical.com (Postfix) with ESMTP id D0A4A240A79 for <cpan-bug+Perl-Critic [...] hipster.bestpractical.com>; Thu, 6 Jun 2013 16:20:29 -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 tXo0uxxBFVaN for <cpan-bug+Perl-Critic [...] hipster.bestpractical.com>; Thu, 6 Jun 2013 16:20:28 -0400 (EDT)
Received: from la.mx.develooper.com (x1.develooper.com [207.171.7.70]) by hipster.bestpractical.com (Postfix) with SMTP id 8BF61240A73 for <bug-Perl-Critic [...] rt.cpan.org>; Thu, 6 Jun 2013 16:20:28 -0400 (EDT)
Received: (qmail 14724 invoked by alias); 6 Jun 2013 20:20:27 -0000
Received: from mail-ea0-f176.google.com (HELO mail-ea0-f176.google.com) (209.85.215.176) by la.mx.develooper.com (qpsmtpd/0.28) with ESMTP; Thu, 06 Jun 2013 13:20:20 -0700
Received: by mail-ea0-f176.google.com with SMTP id z15so65347ead.35 for <bug-Perl-Critic [...] rt.cpan.org>; Thu, 06 Jun 2013 13:20:16 -0700 (PDT)
Received: by 10.223.155.201 with HTTP; Thu, 6 Jun 2013 13:19:56 -0700 (PDT)
Authentication-Results: hipster.bestpractical.com (amavisd-new); dkim=pass header.i= [...] gmail.com
Delivered-To: cpan-bug+Perl-Critic [...] hipster.bestpractical.com
Subject: Possible Bug in Perl::Critic::Policy::Subroutines::RequireFinalReturn
Return-Path: <lorkfudge [...] gmail.com>
X-RT-Mail-Extension: perl-critic
X-Original-To: cpan-bug+Perl-Critic [...] hipster.bestpractical.com
X-Spam-Check-BY: la.mx.develooper.com
Dkim-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:from:date:x-google-sender-auth:message-id :subject:to:content-type; bh=blJcdbHFygzbR1iPGF6MQHFzyijZCQSAnSWghUB9xiI=; b=OtBIXVZQwYqEcvfTVsOZqBzMC7TbFCtkvdb759SjixENFiEb4ooqacyyV6OLuYyEPQ ozNSkQA3a7aCuETFzfzclBhCjldS6HsVVFkT6CiIjE2D5IO0HVttQFiiGK47uRrO3U12 BFgVTugbIS7ZKF4ZokTsNN5YgC/p4v+0bnXc0HYpjo1qZO82NzR40kfEw2mj5/OBFRxE 5bmUAAWMxBUE6OXnLGfpin1FHPni0q8y18Eg5NzYGEZRCRBE36Q0NEPJJME/KPWTpX7V 5ocjoS3/DKjjI/Y4UwCYKbZg5STDeK+jncQ2P3DK0FzFXtrnFLSPdyncFpsgenUrCoyP khzw==
X-Google-Sender-Auth: kVTrJw07xEE2AOmpeFgc_zySAAs
Date: Thu, 6 Jun 2013 16:19:56 -0400
Sender: lorkfudge [...] gmail.com
X-Spam-Level:
To: bug-Perl-Critic [...] rt.cpan.org
From: Zachary Fletcher <buys444 [...] gmail.com>
X-RT-Interface: Email
Content-Length: 0
content-type: text/plain; charset="utf-8"
X-RT-Original-Encoding: iso-8859-1
Content-Length: 518
Download (untitled) / with headers
text/plain 518b
Hi! I found a bug in Perl::Critic::Policy::Subroutines::RequireFinalReturn in revision 4126. When I try to validate the following code "sub foo { if @a { return } }" I get an error (that is perl ciritic crashes instead of telling me I'm doing something stupid). I'm not a perl expert and I'm using a version of perl critic called from a complicated wrapper someone wrote years ago, so the problem could be there as well. I thought I would point it out in case it was a bug so that it could be looked into. Thanks
content-type: text/html; charset="utf-8"
Content-Transfer-Encoding: quoted-printable
X-RT-Original-Encoding: iso-8859-1
Content-Length: 740
From jeff [...] imaginative-software.com Thu Jun 6 17: 29:33 2013
MIME-Version: 1.0 (Apple Message framework v1283)
X-Spam-Status: No, score=-6.381 tagged_above=-99.9 required=10 tests=[AWL=0.518, BAYES_00=-1.9, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_HI=-5] autolearn=ham
In-Reply-To: <rt-4.0.13-2310-1370550030-377.85938-4-0 [...] rt.cpan.org>
X-Mailer: Apple Mail (2.1283)
X-Spam-Flag: NO
X-RT-Interface: API
References: <RT-Ticket-85938 [...] rt.cpan.org> <CAKJxnop_fFcL1iZByjoAG8Esy7_pGEG8TS13OfhhLwoNgUqnDg [...] mail.gmail.com> <rt-4.0.13-2310-1370550030-377.85938-4-0 [...] rt.cpan.org>
X-Virus-Scanned: Debian amavisd-new at bestpractical.com
X-Received: by 10.66.220.197 with SMTP id py5mr41166072pac.86.1370554160597; Thu, 06 Jun 2013 14:29:20 -0700 (PDT)
Content-Type: multipart/alternative; boundary="Apple-Mail=_0B60039D-3B3E-4C7D-91E5-CC0ABBBC94AD"
Message-ID: <C8EF3A1B-2C7F-4802-BD14-074CA0251603 [...] imaginative-software.com>
X-Spam-Score: -6.381
Received: from localhost (localhost [127.0.0.1]) by hipster.bestpractical.com (Postfix) with ESMTP id 9870B240A8E for <cpan-bug+Perl-Critic [...] hipster.bestpractical.com>; Thu, 6 Jun 2013 17:29:33 -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 NRINrgG0uGzG for <cpan-bug+Perl-Critic [...] hipster.bestpractical.com>; Thu, 6 Jun 2013 17:29:31 -0400 (EDT)
Received: from la.mx.develooper.com (x1.develooper.com [207.171.7.70]) by hipster.bestpractical.com (Postfix) with SMTP id 9C135240A7C for <bug-Perl-Critic [...] rt.cpan.org>; Thu, 6 Jun 2013 17:29:31 -0400 (EDT)
Received: (qmail 20452 invoked by alias); 6 Jun 2013 21:29:30 -0000
Received: from mail-pa0-f49.google.com (HELO mail-pa0-f49.google.com) (209.85.220.49) by la.mx.develooper.com (qpsmtpd/0.28) with ESMTP; Thu, 06 Jun 2013 14:29:24 -0700
Received: by mail-pa0-f49.google.com with SMTP id lj1so2018422pab.8 for <bug-Perl-Critic [...] rt.cpan.org>; Thu, 06 Jun 2013 14:29:20 -0700 (PDT)
Received: from [10.0.1.4] (c-69-181-194-211.hsd1.ca.comcast.net. [69.181.194.211]) by mx.google.com with ESMTPSA id wt5sm74319498pbc.38.2013.06.06.14.29.18 for <bug-Perl-Critic [...] rt.cpan.org> (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 06 Jun 2013 14:29:18 -0700 (PDT)
Delivered-To: cpan-bug+Perl-Critic [...] hipster.bestpractical.com
Subject: Re: [rt.cpan.org #85938] Possible Bug in Perl::Critic::Policy::Subroutines::RequireFinalReturn
Return-Path: <jeff [...] imaginative-software.com>
X-Spam-Check-BY: la.mx.develooper.com
X-Original-To: cpan-bug+Perl-Critic [...] hipster.bestpractical.com
X-RT-Mail-Extension: perl-critic
X-Google-Dkim-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:mime-version:content-type:subject:date:in-reply-to:to :references:message-id:x-mailer:x-gm-message-state; bh=l+jd8iMEr+4YwW0QtEgIIVzxtRtk1diEiMhY7QgeAiM=; b=OQOiW5Gn0HX1BAl8Hu3KU2tx0ufSNtLDzve4R88nOTkfhsuwRxeNIXlzSariTi1vPD +uQByUcYu8I2znl9ia7u2o+hrKjoszNMismdwqj2OgWNWXKiFuhlBdUb+4KQNoiULDYa s02GCyEXLL9sp7ldWfGusM6D45DdYczJ4EYVmskqXlQ5j6irKUGl+2EgF6sTIhTxpZwh TI72ADY0ipequ09EU2KrjDV2AW6ODjHBIjFonM68FxuNwIF+w72COa3Yq+KiAQt4UXzK g0WStc+QUDhAnHwUMyzWZMmgXLIj+58hCDlsUHIYKbL2puqMjsn/SYcFtpHZz3ogAvnN Jvtg==
Date: Thu, 6 Jun 2013 14:29:16 -0700
X-Spam-Level:
To: bug-Perl-Critic [...] rt.cpan.org
From: Jeffrey Ryan Thalhammer <jeff [...] imaginative-software.com>
X-GM-Message-State: ALoCoQk1FctLf+Q6nV0FNYNtYFwUc9a9Dr1yFcHDNeDzKRShjj5vBnpZY56aP9DNo5aALt6FsPfC
RT-Message-ID: <rt-4.0.13-2307-1370554174-727.85938-0-0 [...] rt.cpan.org>
Content-Length: 0
content-type: text/plain; charset="utf-8"
Content-Transfer-Encoding: quoted-printable
X-RT-Original-Encoding: utf-8
Content-Length: 843
Download (untitled) / with headers
text/plain 843b
On Jun 6, 2013, at 1:20 PM, Zachary Fletcher via RT wrote: Show quoted text
> When I try to validate the following code "sub foo { if @a { return } }" I > get an error (that is perl ciritic crashes instead of telling me I'm doing > something stupid).
That expression is not syntactically valid perl: $> perl -c -e 'sub foo { if @a { return } }' syntax error at -e line 1, near "if @a " syntax error at -e line 1, near "} }" -e had compilation errors. This is probably what you mean: sub foo { if (@a) { return }} Unfortunately, Perl::Critic can't promise to do anything sane with code that is not syntactically valid. And since Perl::Critic is purely a static analyzer, it can't check the syntax for you. So if you see mysterious errors from Perl::Critic, running `perl -c` over your code is a good first step to diagnose. Hope that helps! -Jeff
content-type: text/html; charset="utf-8"
Content-Transfer-Encoding: quoted-printable
X-RT-Original-Encoding: utf-8
Content-Length: 2165
MIME-Version: 1.0
In-Reply-To: <CAKJxnop_fFcL1iZByjoAG8Esy7_pGEG8TS13OfhhLwoNgUqnDg [...] mail.gmail.com>
X-Mailer: MIME-tools 5.504 (Entity 5.504)
Content-Disposition: inline
X-RT-Interface: Web
References: <CAKJxnop_fFcL1iZByjoAG8Esy7_pGEG8TS13OfhhLwoNgUqnDg [...] mail.gmail.com>
Content-Type: text/plain; charset="utf-8"
Message-ID: <rt-4.0.13-2307-1370554536-740.85938-0-0 [...] rt.cpan.org>
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
X-RT-Encrypt: 0
X-RT-Sign: 0
Content-Length: 1245
Download (untitled) / with headers
text/plain 1.2k
On Thu Jun 06 16:20:30 2013, buys444@gmail.com wrote: Show quoted text
> Hi! > > I found a bug in Perl::Critic::Policy::Subroutines::RequireFinalReturn in > revision 4126. > > When I try to validate the following code "sub foo { if @a { return } }" I > get an error (that is perl ciritic crashes instead of telling me I'm doing > something stupid). > > I'm not a perl expert and I'm using a version of perl critic called from a > complicated wrapper someone wrote years ago, so the problem could be there > as well. > > I thought I would point it out in case it was a bug so that it could be > looked into. > > Thanks
The good news is that I have reproduced your failure and the stack trace makes it look to me like a Perl::Critic error rather than a PPI error. The bad news is that since the failing code does not compile (at least under any Perl easily available to me, and I tried back to 5.8.1) this is probably not going to get a very high priority. When I tried I got $ perl sub foo { if @a { return } } ^D syntax error at - line 1, near "if @a " syntax error at - line 1, near "} }" Execution of - aborted due to compilation errors. Hint: you need parentheses around the "@a". Well, maybe not with Perl 6, but Perl::Critic does not support this.


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.