Skip Menu |

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

Report information
The Basics
Id: 20571
Status: resolved
Priority: 0/
Queue: Perl-Critic-Bangs

People
Owner: Nobody in particular
Requestors: cpan [...] clotho.com
Cc:
AdminCc:

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



Subject: Bangs::ProhibitNumberedNames exceptions
In addition to $1, $2, etc reported in a separate RT ticket, Bangs generates violations on other good variable names, like $md5. Below is a list of variable names that Bangs should probably allow: md5 rc4 sha0 sha1 sha256 x11 win32
From: CLOTHO [...] cpan.org
More: utf8 (and friends) base64 I caught myself using a boolean "$use_utf8". A patch is attached to implement these new exceptions. I'm not offended if the patch is rejected!
Index: lib/Perl/Critic/Policy/Bangs/ProhibitNumberedNames.pm =================================================================== --- lib/Perl/Critic/Policy/Bangs/ProhibitNumberedNames.pm (revision 4) +++ lib/Perl/Critic/Policy/Bangs/ProhibitNumberedNames.pm (working copy) @@ -10,8 +10,15 @@ sub applies_to { return 'PPI::Token::Symbol' } our @DEFAULT_EXCEPTIONS = qw( + base64 md5 + rc4 + sha0 + sha1 + sha256 + utf8 x11 + win32 ); =head1 NAME @@ -43,7 +50,7 @@ This policy starts with a list of numbered names that are legitimate to have ending with a number: - md5, x11 + base64, md5, rc4, sha0, sha1, sha256, utf8, x11, win32 To replace the list of exceptions, pass them into the constructor as a key-value pair where the key is "exceptions" and the value is
These have been added to master on GitHub.