Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

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

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

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

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



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; #-----------------------------------------------------------------------------
Thank you very much for your request, and apologies for taking so long to get to it, but sometimes life intervenes. As you correctly note in your .run file patch, PPI parses most of the augmented operators as two operators (e.g. '<<=' parses as '<<', '=' ). But '//=' appears to be the exception, at least under 1.215. Your patches accepted with thanks and applied as SVN commit 4096.