| 1 | # Copyright 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021 Kevin Ryde | ||||||||||
| 2 | |||||||||||
| 3 | # Perl-Critic-Pulp is free software; you can redistribute it and/or modify | ||||||||||
| 4 | # it under the terms of the GNU General Public License as published by the | ||||||||||
| 5 | # Free Software Foundation; either version 3, or (at your option) any later | ||||||||||
| 6 | # version. | ||||||||||
| 7 | # | ||||||||||
| 8 | # Perl-Critic-Pulp is distributed in the hope that it will be useful, but | ||||||||||
| 9 | # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY | ||||||||||
| 10 | # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | ||||||||||
| 11 | # for more details. | ||||||||||
| 12 | # | ||||||||||
| 13 | # You should have received a copy of the GNU General Public License along | ||||||||||
| 14 | # with Perl-Critic-Pulp. If not, see <http://www.gnu.org/licenses/>. | ||||||||||
| 15 | |||||||||||
| 16 | |||||||||||
| 17 | package Perl::Critic::Policy::ValuesAndExpressions::ProhibitFiletest_f; | ||||||||||
| 18 | 40 | ▶ | use 5.006; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 19 | 40 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 20 | 40 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 21 | |||||||||||
| 22 | 40 | ▶ | use base 'Perl::Critic::Policy'; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 23 | 40 | ▶ | use Perl::Critic::Utils; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 24 | 40 | ▶ | use Perl::Critic::Pulp; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 25 | |||||||||||
| 26 | 40 | our $VERSION = 100; | |||||||||
| 27 | |||||||||||
| 28 | 40 | ▶ | use constant supported_parameters => (); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 29 | 40 | ▶ | use constant default_severity => $Perl::Critic::Utils::SEVERITY_MEDIUM; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 30 | 40 | ▶ | use constant default_themes => qw(pulp bugs); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 31 | 40 | ▶ | use constant applies_to => 'PPI::Token::Operator'; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 32 | |||||||||||
| 33 | 12 | ▶ | sub violates { | ||||||||
|
Subroutine
violates: called CC=2 SCAR=6.9
Pod
documented
| |||||||||||
| 34 | 12 | my ($self, $elem, $document) = @_; | |||||||||
| 35 | |||||||||||
| 36 | 12 | ▶ | return if ($elem->content ne '-f'); | ||||||||
|
Branch: 1 branch
| |||||||||||
| 37 | 6 | return $self->violation ("Don't use the -f file test", '', $elem); | |||||||||
| 38 | } | ||||||||||
| 39 | |||||||||||
| 40 | 40 | 1; | |||||||||
| 41 | __END__ | ||||||||||