-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathperlcriticrc-strict
241 lines (180 loc) · 8.7 KB
/
perlcriticrc-strict
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
color = 1
only = 1
verbose = [%p] %m at %f line %l, near '%r'\n
severity = 2
color-severity-highest = bold red
color-severity-high = yellow
color-severity-medium = bold blue
color-severity-low = blue
color-severity-lowest = magenta
#pager = less
# -----------------
# - Core policies -
# -----------------
# It is unsafe to call: require "string"
# It is wrong to call: eval "string"
[BuiltinFunctions::ProhibitStringyEval]
[BuiltinFunctions::ProhibitStringySplit]
severity = 3
# Also: use Safe::Isa
[BuiltinFunctions::ProhibitUniversalCan]
[BuiltinFunctions::ProhibitUniversalIsa]
[ClassHierarchies::ProhibitAutoloading]
# Also: use parent
[ClassHierarchies::ProhibitExplicitISA]
[ClassHierarchies::ProhibitOneArgBless]
[ControlStructures::ProhibitLabelsWithSpecialBlockNames]
[ControlStructures::ProhibitUnreachableCode]
[ErrorHandling::RequireCheckingReturnValueOfEval]
[InputOutput::ProhibitBarewordFileHandles]
[InputOutput::ProhibitOneArgSelect]
[InputOutput::ProhibitTwoArgOpen]
[InputOutput::RequireCheckedOpen]
[InputOutput::RequireCheckedSyscalls]
functions = :builtins
#exclude_functions = print close sleep say
[InputOutput::RequireEncodingWithUTF8Layer]
[Miscellanea::ProhibitFormats]
[Miscellanea::ProhibitTies]
[Miscellanea::ProhibitUselessNoCritic]
[Modules::ProhibitConditionalUseStatements]
# Added: Readonly, base, File::Slurp, common::sense, Class::Load,
# Any::Moose, Error, Getopt::Std, HTML::Template,
# IO::Socket::INET6, JSON::PP, JSON::Any, List::MoreUtils, Mouse,
# Net::IRC, XML::Simple, Sub::Infix, Dancer, Try::Tiny
[Modules::ProhibitEvilModules]
modules = Class::ISA {Found use of Class::ISA. This module is deprecated by the Perl 5 Porters.} Pod::Plainer {Found use of Pod::Plainer. This module is deprecated by the Perl 5 Porters.} Shell {Found use of Shell. This module is deprecated by the Perl 5 Porters.} Switch {Found use of Switch. This module is deprecated by the Perl 5 Porters.} Readonly {Found use of Readonly. Please use constant.pm or Const::Fast.} base {Found use of base. Please use parent instead.} File::Slurp {Found use of File::Slurp. Please use Path::Tiny instead.} common::sense {Found use of common::sense. Please use strict and warnings instead.} Class::Load {Found use of Class::Load. Please use Module::Runtime instead.} Any::Moose {Found use of Any::Moose. Please use Moo instead.} Error {Found use of Error.pm. Please use Throwable.pm instead.} Getopt::Std {Found use of Getopt::Std. Please use Getopt::Long instead.} HTML::Template {Found use of HTML::Template. Please use Template::Toolkit.} IO::Socket::INET6 {Found use of IO::Socket::INET6. Please use IO::Socket::IP.} JSON::PP {Found use of JSON:PP. Please use JSON.} JSON::Any {Found use of JSON::Any. Please use JSON::MaybeXS.} List::MoreUtils {Found use of List::MoreUtils. Please use Bookings::Tools::List or List::Util or List::UtilsBy.} Mouse {Found use of Mouse. Please use Moo.} Net::IRC {Found use of Net::IRC. Please use POE::Component::IRC, Net::Async::IRC, or Mojo::IRC.} XML::Simple {Found use of XML::Simple. Please use XML::LibXML, XML::TreeBuilder, XML::Twig, or Mojo::DOM.} Sub::Infix {Found use of Sub::Infix. Please do not use it.} Dancer {Dancer is not supported. Please use Dancer2.} Try::Tiny {Found use of Try::Tiny. Please use eval or do instead.}
#modules_file =
[Modules::ProhibitMultiplePackages]
[Modules::RequireBarewordIncludes]
[Modules::RequireExplicitPackage]
# No point requiring "package main"
exempt_scripts = 1
# We should exempt tests of this
# Dancer2 tests have { package App; use Dancer2 } App->to_app...
[Modules::RequireFilenameMatchesPackage]
[Objects::ProhibitIndirectSyntax]
# Values that are always included: new.
#forbid =
# Not really problems, but might be speed optimizations
#[RegularExpressions::ProhibitFixedStringMatches]
#[RegularExpressions::ProhibitSingleCharAlternation]
# These can just be cleaned up, not really bugs
#[RegularExpressions::ProhibitUselessTopic]
[Subroutines::ProhibitAmpersandSigils]
# This is sometimes necessary
#[Subroutines::ProhibitBuiltinHomonyms]
# Adjust over time
#[Subroutines::ProhibitExcessComplexity]
#max_mccabe = 200
[Subroutines::ProhibitNestedSubs]
[Subroutines::ProhibitReturnSort]
[TestingAndDebugging::ProhibitNoStrict]
# This is a common patterns to (re)define glob CODE entries
allow = refs
[TestingAndDebugging::ProhibitNoWarnings]
# These might be acceptable by some
# "redefine" and "once" are very useful for tests
#allow = redefine once prototypes
[TestingAndDebugging::RequireUseStrict]
severity = 5
equivalent_modules = Dancer Dancer2 Moo Moose Moo::Role Moose::Role strictures
[TestingAndDebugging::RequireUseWarnings]
severity = 5
equivalent_modules = Dancer Dancer2 Moo Moose Moo::Role Moose::Role strictures
# This is often unintended!
[ValuesAndExpressions::ProhibitCommaSeparatedStatements]
# Allow map and grep blocks to return lists.
allow_last_statement_to_be_comma_separated_in_map_and_grep = 0
# Arguable
[ValuesAndExpressions::ProhibitEscapedCharacters]
[ValuesAndExpressions::ProhibitLeadingZeros]
# builtins that deal with Unix permissions, e.g. chmod, don't get flagged.
strict = 0
[ValuesAndExpressions::ProhibitMismatchedOperators]
[ValuesAndExpressions::ProhibitQuotesAsQuotelikeOperatorDelimiters]
[ValuesAndExpressions::ProhibitSpecialLiteralHeredocTerminator]
# Because it's easy to fix
#[ValuesAndExpressions::RequireNumberSeparators]
#[ValuesAndExpressions::RequireUpperCaseHeredocTerminator]
# This should probably be the next bump, though...
#[ValuesAndExpressions::RequireQuotedHeredocTerminator]
[Variables::ProhibitAugmentedAssignmentInDeclaration]
[Variables::ProhibitConditionalDeclarations]
[Variables::ProhibitPerl4PackageNames]
[Variables::ProhibitReusedNames]
[Variables::ProhibitUnusedVariables]
# Write `for my $element (@list) {...}' instead of `for $element (@list) {...}'.
# What about postfix "for"
[Variables::RequireLexicalLoopIterators]
# -----------------------
# - Perl::Critic::Moose -
# -----------------------
[Moose::ProhibitDESTROYMethod]
equivalent_modules = Moo Moo::Role
[Moose::ProhibitMultipleWiths]
equivalent_modules = Moo Moo::Role
[Moose::ProhibitNewMethod]
equivalent_modules = Moo Moo::Role
[Moose::RequireCleanNamespace]
[Moose::ProhibitLazyBuild]
# We *shouldn't have make_immutable() in Moo
# The opposite of this
[Moose::RequireMakeImmutable]
# -------------------------------------------------------------------
# - Perl::Critic::Policy::ValuesAndExpressions::PreventSQLInjection -
# -------------------------------------------------------------------
[ValuesAndExpressions::PreventSQLInjection]
#-----------------------------------------------------
# - Perl::Critic::Policy::Moo::ProhibitMakeImmutable -
#-----------------------------------------------------
[Moo::ProhibitMakeImmutable]
#-------------------------------------
# - Perl::Critic::Policy::Perlsecret -
#-------------------------------------
# 0.0.9
[Perlsecret]
allow_secrets = Bang Bang, Venus, Winking Fat Comma
#--------------------------------------
# - Perl::Critic::Policy::HTTPCookies -
#--------------------------------------
[HTTPCookies]
#---------------------------
# - Perl::Critic::Freenode -
#---------------------------
[Freenode::AmpersandSubCalls]
[Freenode::ArrayAssignAref]
[Freenode::BarewordFilehandles]
[Freenode::ConditionalDeclarations]
[Freenode::ConditionalImplicitReturn]
[Freenode::DeprecatedFeatures]
[Freenode::DollarAB]
[Freenode::Each]
# This also checks for one-arg open(), unlike the core policy
[Freenode::OpenArgs]
# Does *not* get confused with signatures
[Freenode::Prototypes]
[Freenode::Threads]
[Freenode::Wantarray]
[Freenode::WarningsSwitch]
[Freenode::WhileDiamondDefaultAssignment]
[ValuesAndExpressions::UnexpandedSpecialLiteral]
[ValuesAndExpressions::ProhibitUnknownBackslash]
[ValuesAndExpressions::NotWithCompare]
[ValuesAndExpressions::ProhibitDuplicateHashKeys]
[ValuesAndExpressions::ProhibitArrayAssignAref]
[ValuesAndExpressions::ConstantBeforeLt]
[CodeLayout::ProhibitFatCommaNewline]
[Modules::ProhibitPOSIXimport]
#-------------------------------------------------------------------
# - Perl::Critic::Policy::BuiltinFunctions::ProhibitDeleteOnArrays -
#-------------------------------------------------------------------
[BuiltinFunctions::ProhibitDeleteOnArrays]
# ------------------------------------------------------------
# - Perl::Critic::Policy::BuiltinFunctions::ProhibitReturnOr -
# ------------------------------------------------------------
[BuiltinFunctions::ProhibitReturnOr]
# ---------------------------------------------------------------------------
# - Perl::Critic::Policy::ValuesAndExpressions::ProhibitSingleArgArraySlice -
# ---------------------------------------------------------------------------
[ValuesAndExpressions::ProhibitSingleArgArraySlice]