Skip Menu |

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

Report information
The Basics
Id: 28803
Status: open
Priority: 0/
Queue: Perl-Critic-More

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

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



Subject: probihit inheritance assignments outside BEGIN block
I wish for a policy that alerts about a circularity trap. See details at http://www.perlfoundation.org/perl5/ index.cgi?why_put_isa_and_export_in_a_begin_block
On Sun Aug 12 12:28:40 2007, DAXIM wrote: Show quoted text
> I wish for a policy that alerts about a circularity trap. See details > at http://www.perlfoundation.org/perl5/ > index.cgi?why_put_isa_and_export_in_a_begin_block
That seems pretty obscure. Why not just "use base" instead of @INC? Nonetheless, I've added it to the TODO list. The implementation would probably be: * look for @INC - else return * check if it's the lhs of an assignment - else return * recurse up to see if it's inside a PPI::Statement::Scheduled - if we hit the top of the tree, return * check that statement is a BEGIN - else return * emit violation.
On Sun Aug 12 12:51:56 2007, CDOLAN wrote: Show quoted text
> On Sun Aug 12 12:28:40 2007, DAXIM wrote:
> > I wish for a policy that alerts about a circularity trap. See details > > at http://www.perlfoundation.org/perl5/ > > index.cgi?why_put_isa_and_export_in_a_begin_block
> > That seems pretty obscure. Why not just "use base" instead of @INC? > Nonetheless, I've added it to the TODO list. > > The implementation would probably be: > * look for @INC > - else return > * check if it's the lhs of an assignment > - else return > * recurse up to see if it's inside a PPI::Statement::Scheduled > - if we hit the top of the tree, return > * check that statement is a BEGIN > - else return > * emit violation.
Oops, bug in that pseudocode. Should be: - if we hit the top of the tree, emit violation