Subject: | Policies missing operators |
From: | MOREGAN [...] cpan.org |
Perl::Critic::Utils and Perl::Critic::Policy::ControlStructures::ProhibitMutatingListFunctions contain lists of operators that have omissions.
Index: lib/Perl/Critic/Utils.pm
===================================================================
--- lib/Perl/Critic/Utils.pm (revision 4091)
+++ lib/Perl/Critic/Utils.pm (working copy)
@@ -307,6 +307,7 @@
'^=' => 19,
'<<=' => 19,
'>>=' => 19,
+ '//=' => 19,
',' => 20,
'=>' => 20,
'not' => 22,
Index: lib/Perl/Critic/Policy/ControlStructures/ProhibitMutatingListFunctions.pm
===================================================================
--- lib/Perl/Critic/Policy/ControlStructures/ProhibitMutatingListFunctions.pm (revision 4091)
+++ lib/Perl/Critic/Policy/ControlStructures/ProhibitMutatingListFunctions.pm (working copy)
@@ -232,7 +232,7 @@
{
##no critic(ArgUnpacking)
- my %assignment_ops = hashify qw( = *= /= += -= %= **= x= .= &= |= ^= &&= ||= ++ -- );
+ my %assignment_ops = hashify qw( = *= /= += -= %= **= x= .= &= |= ^= &&= ||= <<= >>= //= ++ -- );
sub _is_assignment_operator { return exists $assignment_ops{$_[0]} }
my %increment_ops = hashify qw( ++ -- );
Index: t/ControlStructures/ProhibitMutatingListFunctions.run
===================================================================
--- t/ControlStructures/ProhibitMutatingListFunctions.run (revision 4091)
+++ t/ControlStructures/ProhibitMutatingListFunctions.run (working copy)
@@ -1,10 +1,13 @@
## name Assignment and op-assignment
-## failures 3
+## failures 4
## cut
+# PPI as of 1.215 doesn't parse all of the augmented assignment operators,
+# so we can't do exhaustive testing.
@bar = map {$_ = 1} @foo;
@bar = map {$_ *= 2} @foo;
@bar = map {$_++} @foo;
+@bar = map {$_--} @foo;
#-----------------------------------------------------------------------------