Login
Created a new Policy to prohibit an unrestricted ## no critic.
[gknop/Perl-Critic.git] / lib / Perl / Critic.pm
index 6593e85..02fb5fd 100644 (file)
@@ -215,8 +215,10 @@ sub _critique {
             for my $violation ( $policy->violates( $element, $doc ) ) {
                 my $line = $violation->location()->[0];
                 if (exists $is_line_disabled->{$line}) {
-                    next VIOLATION if $is_line_disabled->{$line}->{$policy_name};
-                    next VIOLATION if $is_line_disabled->{$line}->{ALL};
+                    next VIOLATION if $is_line_disabled->{$line}->{$policy_name}
+                        && $policy->can_be_disabled();
+                    next VIOLATION if $is_line_disabled->{$line}->{ALL}
+                        && $policy->can_be_disabled();
                 }
 
                 push @violations, $violation;