Subject: | RequireUseStrict and RequireUseWarnings don't handle Moose::Role |
Date: | Thu, 10 Apr 2008 13:57:05 -0400 |
To: | bug-Perl-Critic [...] rt.cpan.org |
From: | Bernardo Rechea <brbpub [...] gmail.com> |
In the same way that an exception is made for 'use Moose' as being equivalent
to 'use strict' and 'use warnings', an exception should be made for 'use
Moose::Role, because it also enables strict and warnings.
Changing the third test in subs _is_use_strict() and _is_use_warnings() from
return 0 if $elem->pragma() ne 'strict' && $elem->module() ne 'Moose';
to
return 0 if $elem->pragma() ne 'strict' &&
$elem->module() !~ /^Moose(?:::Role)?$/;
adds the exception for Moose::Role.
I'm running Perl::Critic v1.802 with Perl 5.10 on SuSE Linux 10.2.
Bernardo Rechea