Skip Menu |

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

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

People
Owner: Nobody in particular
Requestors: eda [...] waniasset.com
Cc:
AdminCc:

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



Subject: Bug 100291 - ProhibitNullStatements
Date: Mon, 2 Mar 2015 12:45:20 +0000
To: "'bug-Perl-Critic-Pulp [...] rt.cpan.org'" <bug-Perl-Critic-Pulp [...] rt.cpan.org>
From: Ed Avis <eda [...] waniasset.com>
Thanks for looking into the bug https://rt.cpan.org/Public/Bug/Display.html?id=100291 I am not able to update it on the web interface so I comment here. It says that version 89 has some code to detect 'try' and 'catch', but I find that the following test case use TryCatch; try { $dbh = db_connect } exit 1; still produces the error Null statement (stray semicolon) [ValuesAndExpressions::ProhibitNullStatements] -- Ed Avis <eda@waniasset.com> Show quoted text
______________________________________________________________________ This email has been scanned by the Symantec Email Security.cloud service. For more information please visit http://www.symanteccloud.com
______________________________________________________________________
Subject: Re: [rt.cpan.org #102448] Bug 100291 - ProhibitNullStatements
Date: Tue, 03 Mar 2015 20:04:00 +1100
To: "Ed Avis via RT" <bug-Perl-Critic-Pulp [...] rt.cpan.org>
From: Kevin Ryde <user42_kevin [...] yahoo.com.au>
"Ed Avis via RT" <bug-Perl-Critic-Pulp@rt.cpan.org> writes: Show quoted text
> > use TryCatch; > try { $dbh = db_connect } > exit 1;
Thanks. ppi gives that as one "statement". I'll look for where the try actually ends. (The wrong report treats the "exit" as part of the try.)
Subject: Re: [rt.cpan.org #102448] Bug 100291 - ProhibitNullStatements
Date: Sat, 07 Mar 2015 19:26:45 +1100
To: "Ed Avis via RT" <bug-Perl-Critic-Pulp [...] rt.cpan.org>
From: Kevin Ryde <user42_kevin [...] yahoo.com.au>
I applied a fix for version 90. It's imperfect since PPI puts everything after a try{} as part of that one statement. I imagine that will affect other bits of perlcritic too in subtle ways. Could think about lobbying PPI for some hook to let syntax-mangling modules declare their style or supply code which parses. Though alas I haven't had good response from PPI even for simple things. If extra PPI compound statement classes were needed then parts of perlcritic might have to recognise them, but at least expressions vs code vs etc would be parsed.
Subject: Re: [rt.cpan.org #102448] Bug 100291 - ProhibitNullStatements
Date: Sat, 7 Mar 2015 16:18:01 +0000
To: "bug-Perl-Critic-Pulp [...] rt.cpan.org" <bug-Perl-Critic-Pulp [...] rt.cpan.org>
From: Ed Avis <eda [...] waniasset.com>
Thanks. I think it is time for try and catch to be added as first-class primitives to the Perl 5 language. Perhaps if the current work on adding decent OO (making Moose built in, effectively) is a success then the perl5-porters will look at try and catch next. Failing that, PPI could parse them as a special case. That sounds saner than the tar pit of letting modules hook into PPI for their own particular syntax mangles. Show quoted text
______________________________________________________________________ This email has been scanned by the Symantec Email Security.cloud service. For more information please visit http://www.symanteccloud.com
______________________________________________________________________
Subject: Re: [rt.cpan.org #102448] Bug 100291 - ProhibitNullStatements
Date: Wed, 11 Mar 2015 17:08:43 +1100
To: "Ed Avis via RT" <bug-Perl-Critic-Pulp [...] rt.cpan.org>
From: Kevin Ryde <user42_kevin [...] yahoo.com.au>
"Ed Avis via RT" <bug-Perl-Critic-Pulp@rt.cpan.org> writes: Show quoted text
> > (making Moose built in, effectively)
Hope not. I tried it but didn't enjoy it. Show quoted text
> Failing that, PPI could parse them as a special case.
Could do. I think only one of the three modules has a "finally" block, if I'm not mistaken, which difference might require something subtle.
Believe the ProhibitNullStatements part of try/catch is reasonable now (though I'm starting to lose track of what else I'm supposed to be doing :-).