Debian Codegraph @

t/perlcriticrc

raw
1 # Globals
2 severity = 4
3 # force = 0
4 # only = 0
5 # profile-strictness = warn
6 # color = 0
7 # pager =
8 # top = 0
9 # verbose = 4
10 # include =
11 # exclude =
12 # single-policy =
13 # theme =
14 # color-severity-highest = bold red
15 # color-severity-high = magenta
16 # color-severity-medium =
17 # color-severity-low =
18 # color-severity-lowest =
19
20 # Use `List::MoreUtils::any' instead of `grep' in boolean context.
21 [BuiltinFunctions::ProhibitBooleanGrep]
22 severity = 2
23
24
25 # Map blocks should have a single statement.
26 [BuiltinFunctions::ProhibitComplexMappings]
27 severity = 3
28
29 # The maximum number of statements to allow within a map block.
30 # Minimum value 1. No maximum.
31 # max_statements = 1
32
33
34 # Use 4-argument `substr' instead of writing `substr($foo, 2, 6) = $bar'.
35 [BuiltinFunctions::ProhibitLvalueSubstr]
36 severity = 3
37
38
39 # Forbid $b before $a in sort blocks.
40 [BuiltinFunctions::ProhibitReverseSortBlock]
41 severity = 1
42
43
44 # Use Time::HiRes instead of something like `select(undef, undef, undef, .05)'.
45 [BuiltinFunctions::ProhibitSleepViaSelect]
46 severity = 5
47
48
49 # Write `eval { my $foo; bar($foo) }' instead of `eval "my $foo; bar($foo);"'.
50 [BuiltinFunctions::ProhibitStringyEval]
51 severity = 5
52
53 # Allow eval of "use" and "require" strings.
54 # allow_includes = 0
55
56
57 # Write `split /-/, $string' instead of `split '-', $string'.
58 [BuiltinFunctions::ProhibitStringySplit]
59 severity = 2
60
61
62 # Write `eval { $foo->can($name) }' instead of `UNIVERSAL::can($foo, $name)'.
63 [BuiltinFunctions::ProhibitUniversalCan]
64 severity = 3
65
66
67 # Write `eval { $foo->isa($pkg) }' instead of `UNIVERSAL::isa($foo, $pkg)'.
68 [BuiltinFunctions::ProhibitUniversalIsa]
69 severity = 3
70
71
72 # Don't use `grep' in void contexts.
73 [BuiltinFunctions::ProhibitVoidGrep]
74 severity = 3
75
76
77 # Don't use `map' in void contexts.
78 [BuiltinFunctions::ProhibitVoidMap]
79 severity = 3
80
81
82 # Write `grep { $_ =~ /$pattern/ } @list' instead of `grep /$pattern/, @list'.
83 [BuiltinFunctions::RequireBlockGrep]
84 severity = 4
85
86
87 # Write `map { $_ =~ /$pattern/ } @list' instead of `map /$pattern/, @list'.
88 [BuiltinFunctions::RequireBlockMap]
89 severity = 4
90
91
92 # Use `glob q{*}' instead of <*>.
93 [BuiltinFunctions::RequireGlobFunction]
94 severity = 5
95
96
97 # Sort blocks should have a single statement.
98 [BuiltinFunctions::RequireSimpleSortBlock]
99 severity = 3
100
101
102 # AUTOLOAD methods should be avoided.
103 [ClassHierarchies::ProhibitAutoloading]
104 severity = 3
105
106
107 # Employ `use base' instead of `@ISA'.
108 [ClassHierarchies::ProhibitExplicitISA]
109 severity = 3
110
111
112 # Write `bless {}, $class;' instead of just `bless {};'.
113 [ClassHierarchies::ProhibitOneArgBless]
114 severity = 5
115
116
117 # Use spaces instead of tabs.
118 [CodeLayout::ProhibitHardTabs]
119 severity = 3
120
121 # Allow hard tabs before first non-whitespace character.
122 # allow_leading_tabs = 1
123
124
125 # Write `open $handle, $path' instead of `open($handle, $path)'.
126 [CodeLayout::ProhibitParensWithBuiltins]
127 severity = 1
128
129
130 # Write `qw(foo bar baz)' instead of `('foo', 'bar', 'baz')'.
131 [CodeLayout::ProhibitQuotedWordLists]
132 severity = 2
133
134 # The minimum number of words in a list that will be complained about.
135 # Minimum value 1. No maximum.
136 # min_elements = 2
137
138 # Complain even if there are non-word characters in the values.
139 # strict = 0
140
141
142 # Don't use whitespace at the end of lines.
143 [CodeLayout::ProhibitTrailingWhitespace]
144 severity = 1
145
146
147 # Use the same newline through the source.
148 [CodeLayout::RequireConsistentNewlines]
149 severity = 4
150
151
152 # Put a comma at the end of every multi-line list declaration, including the last one.
153 [CodeLayout::RequireTrailingCommas]
154 severity = 1
155
156
157 # Write `for(0..20)' instead of `for($i=0; $i<=20; $i++)'.
158 [ControlStructures::ProhibitCStyleForLoops]
159 severity = 2
160
161
162 # Don't write long "if-elsif-elsif-elsif-elsif...else" chains.
163 [ControlStructures::ProhibitCascadingIfElse]
164 severity = 3
165
166 # The maximum number of alternatives that will be allowed.
167 # Minimum value 1. No maximum.
168 # max_elsif = 2
169
170
171 # Don't write deeply nested loops and conditionals.
172 [ControlStructures::ProhibitDeepNests]
173 severity = 3
174
175 # The maximum number of nested constructs to allow.
176 # Minimum value 1. No maximum.
177 # max_nests = 5
178
179
180 # Don't use labels that are the same as the special block names.
181 [ControlStructures::ProhibitLabelsWithSpecialBlockNames]
182 severity = 4
183
184
185 # Don't modify `$_' in list functions.
186 [ControlStructures::ProhibitMutatingListFunctions]
187 severity = 5
188
189 # The base set of functions to check.
190 # list_funcs = map grep List::Util::first List::MoreUtils::any List::MoreUtils::all List::MoreUtils::none List::MoreUtils::notall List::MoreUtils::true List::MoreUtils::false List::MoreUtils::firstidx List::MoreUtils::first_index List::MoreUtils::lastidx List::MoreUtils::last_index List::MoreUtils::insert_after List::MoreUtils::insert_after_string
191
192 # The set of functions to check, in addition to those given in list_funcs.
193 # add_list_funcs =
194
195
196 # Don't use operators like `not', `!~', and `le' within `until' and `unless'.
197 [ControlStructures::ProhibitNegativeExpressionsInUnlessAndUntilConditions]
198 severity = 3
199
200
201 # Write `if($condition){ do_something() }' instead of `do_something() if $condition'.
202 [ControlStructures::ProhibitPostfixControls]
203 severity = 2
204
205 # The permitted postfix controls.
206 # Valid values: for, foreach, if, unless, until, while.
207 # allow =
208
209 # The exempt flow control functions.
210 # flowcontrol = carp cluck confess croak die exit goto warn
211
212
213 # Write `if(! $condition)' instead of `unless($condition)'.
214 [ControlStructures::ProhibitUnlessBlocks]
215 severity = 2
216
217
218 # Don't write code after an unconditional `die, exit, or next'.
219 [ControlStructures::ProhibitUnreachableCode]
220 severity = 4
221
222
223 # Write `while(! $condition)' instead of `until($condition)'.
224 [ControlStructures::ProhibitUntilBlocks]
225 severity = 2
226
227
228 # The `=head1 NAME' section should match the package.
229 [Documentation::RequirePackageMatchesPodName]
230 severity = 1
231
232
233 # All POD should be after `__END__'.
234 [Documentation::RequirePodAtEnd]
235 severity = 1
236
237
238 # Organize your POD into the customary sections.
239 [Documentation::RequirePodSections]
240 severity = 2
241
242 # The sections to require for modules (separated by qr/\s* [|] \s*/xms).
243 # lib_sections =
244
245 # The sections to require for programs (separated by qr/\s* [|] \s*/xms).
246 # script_sections =
247
248 # The origin of sections to use.
249 # Valid values: book, book_first_edition, module_starter_pbp, module_starter_pbp_0_0_3.
250 # source = book_first_edition
251
252 # The spelling of sections to use.
253 # Valid values: en_AU, en_US.
254 # language =
255
256
257 # Use functions from Carp instead of `warn' or `die'.
258 [ErrorHandling::RequireCarping]
259 severity = 3
260
261 # Don't complain about die or warn if the message ends in a newline.
262 # allow_messages_ending_with_newlines = 1
263
264
265 # You can't depend upon the value of `$@'/`$EVAL_ERROR' to tell whether an `eval' failed.
266 [ErrorHandling::RequireCheckingReturnValueOfEval]
267 severity = 4
268
269
270 # Discourage stuff like `@files = `ls $directory`'.
271 [InputOutput::ProhibitBacktickOperators]
272 severity = 3
273
274 # Allow backticks everywhere except in void contexts.
275 # only_in_void_context =
276
277
278 # Write `open my $fh, q{<}, $filename;' instead of `open FH, q{<}, $filename;'.
279 [InputOutput::ProhibitBarewordFileHandles]
280 severity = 5
281
282 # swapped < for &lt; to stop module-starter carping
283 # Use "<>" or "&lt;ARGV>" or a prompting module instead of "&lt;STDIN>".
284 [InputOutput::ProhibitExplicitStdin]
285 severity = 4
286
287
288 # Use prompt() instead of -t.
289 [InputOutput::ProhibitInteractiveTest]
290 severity = 5
291
292
293 # Use `local $/ = undef' or File::Slurp instead of joined readline.
294 [InputOutput::ProhibitJoinedReadline]
295 severity = 4
296
297
298 # Never write `select($fh)'.
299 [InputOutput::ProhibitOneArgSelect]
300 severity = 4
301
302
303 # Write `while( $line = <> ){...}' instead of `for(<>){...}'.
304 [InputOutput::ProhibitReadlineInForLoop]
305 severity = 5
306
307
308 # Write `open $fh, q{<}, $filename;' instead of `open $fh, "<$filename";'.
309 [InputOutput::ProhibitTwoArgOpen]
310 severity = 5
311
312
313 # Write `print {$FH} $foo, $bar;' instead of `print $FH $foo, $bar;'.
314 [InputOutput::RequireBracedFileHandleWithPrint]
315 severity = 1
316
317
318 # Close filehandles as soon as possible after opening them.
319 [InputOutput::RequireBriefOpen]
320 severity = 4
321
322 # The maximum number of lines between an open() and a close().
323 # Minimum value 1. No maximum.
324 # IJW: set to about a screen-length or so.
325 lines = 30
326
327
328 # Write `my $error = close $fh;' instead of `close $fh;'.
329 [InputOutput::RequireCheckedClose]
330 severity = 2
331
332
333 # Write `my $error = open $fh, $mode, $filename;' instead of `open $fh, $mode, $filename;'.
334 [InputOutput::RequireCheckedOpen]
335 severity = 4
336
337
338 # Return value of flagged function ignored.
339 [InputOutput::RequireCheckedSyscalls]
340 severity = 2
341
342 # The set of functions to require checking the return value of.
343 # functions = open close print
344
345 # The set of functions to not require checking the return value of.
346 # exclude_functions =
347
348
349 # Do not use `format'.
350 [Miscellanea::ProhibitFormats]
351 severity = 3
352
353
354 # Do not use `tie'.
355 [Miscellanea::ProhibitTies]
356 severity = 2
357
358
359 # Forbid a bare `## no critic'
360 [Miscellanea::ProhibitUnrestrictedNoCritic]
361 severity = 3
362
363
364 # Remove ineffective "## no critic" annotations.
365 [Miscellanea::ProhibitUselessNoCritic]
366 severity = 2
367
368
369 # Put source-control keywords in every file.
370 [Miscellanea::RequireRcsKeywords]
371 severity = 2
372
373 # The keywords to require in all files.
374 # keywords =
375
376
377 # Export symbols via `@EXPORT_OK' or `%EXPORT_TAGS' instead of `@EXPORT'.
378 [Modules::ProhibitAutomaticExportation]
379 severity = 4
380
381
382 # Minimize complexity in code that is outside of subroutines.
383 [Modules::ProhibitExcessMainComplexity]
384 severity = 3
385
386 # The maximum complexity score allowed.
387 # Minimum value 1. No maximum.
388 # max_mccabe = 20
389
390
391 # Put packages (especially subclasses) in separate files.
392 [Modules::ProhibitMultiplePackages]
393 severity = 4
394
395
396 # Write `require Module' instead of `require 'Module.pm''.
397 [Modules::RequireBarewordIncludes]
398 severity = 5
399
400
401 # End each module with an explicitly `1;' instead of some funky expression.
402 [Modules::RequireEndWithOne]
403 severity = 4
404
405
406 # Always make the `package' explicit.
407 [Modules::RequireExplicitPackage]
408 severity = 4
409 # maximum_violations_per_document = 1
410
411 # Don't require programs to contain a package statement.
412 # exempt_scripts = 1
413
414
415 # Package declaration must match filename.
416 [Modules::RequireFilenameMatchesPackage]
417 severity = 5
418
419
420 # `use English' must be passed a `-no_match_vars' argument.
421 [Modules::RequireNoMatchVarsWithUseEnglish]
422 severity = 2
423
424
425 # Give every module a `$VERSION' number.
426 [Modules::RequireVersionVar]
427 severity = 2
428
429
430 # Distinguish different program components by case.
431 [NamingConventions::Capitalization]
432 severity = 3
433
434 # How package name components should be capitalized. Valid values are :single_case, :all_lower, :all_upper:, :starts_with_lower, :starts_with_upper, :no_restriction, or a regex.
435 # packages = :starts_with_upper
436
437 # Package names that are exempt from capitalization rules. The values here are regexes that will be surrounded by \A and \z.
438 # package_exemptions = main
439
440 # How subroutine names should be capitalized. Valid values are :single_case, :all_lower, :all_upper, :starts_with_lower, :starts_with_upper, :no_restriction, or a regex.
441 # subroutines = :single_case
442
443 # Subroutine names that are exempt from capitalization rules. The values here are regexes that will be surrounded by \A and \z.
444 # subroutine_exemptions = AUTOLOAD BUILD BUILDARGS CLEAR CLOSE DELETE DEMOLISH DESTROY EXISTS EXTEND FETCH FETCHSIZE FIRSTKEY GETC NEXTKEY POP PRINT PRINTF PUSH READ READLINE SCALAR SHIFT SPLICE STORE STORESIZE TIEARRAY TIEHANDLE TIEHASH TIESCALAR UNSHIFT UNTIE WRITE
445
446 # How local lexical variables names should be capitalized. Valid values are :single_case, :all_lower, :all_upper, :starts_with_lower, :starts_with_upper, :no_restriction, or a regex.
447 # local_lexical_variables = :single_case
448
449 # Local lexical variable names that are exempt from capitalization rules. The values here are regexes that will be surrounded by \A and \z.
450 # local_lexical_variable_exemptions =
451
452 # How lexical variables that are scoped to a subset of subroutines, should be capitalized. Valid values are :single_case, :all_lower, :all_upper, :starts_with_lower, :starts_with_upper, :no_restriction, or a regex.
453 # scoped_lexical_variables = :single_case
454
455 # Names for variables in anonymous blocks that are exempt from capitalization rules. The values here are regexes that will be surrounded by \A and \z.
456 # scoped_lexical_variable_exemptions =
457
458 # How lexical variables at the file level should be capitalized. Valid values are :single_case, :all_lower, :all_upper, :starts_with_lower, :starts_with_upper, :no_restriction, or a regex.
459 # file_lexical_variables = :single_case
460
461 # File-scope lexical variable names that are exempt from capitalization rules. The values here are regexes that will be surrounded by \A and \z.
462 # file_lexical_variable_exemptions =
463
464 # How global (package) variables should be capitalized. Valid values are :single_case, :all_lower, :all_upper, :starts_with_lower, :starts_with_upper, :no_restriction, or a regex.
465 # global_variables = :single_case
466
467 # Global variable names that are exempt from capitalization rules. The values here are regexes that will be surrounded by \A and \z.
468 # global_variable_exemptions = \$VERSION @ISA @EXPORT(?:_OK)? %EXPORT_TAGS \$AUTOLOAD %ENV %SIG \$TODO
469
470 # How constant names should be capitalized. Valid values are :single_case, :all_lower, :all_upper, :starts_with_lower, :starts_with_upper, :no_restriction, or a regex.
471 # constants = :all_upper
472
473 # Constant names that are exempt from capitalization rules. The values here are regexes that will be surrounded by \A and \z.
474 # constant_exemptions =
475
476 # How labels should be capitalized. Valid values are :single_case, :all_lower, :all_upper, :starts_with_lower, :starts_with_upper, :no_restriction, or a regex.
477 # labels = :all_upper
478
479 # Labels that are exempt from capitalization rules. The values here are regexes that will be surrounded by \A and \z.
480 # label_exemptions =
481
482
483 # Don't use vague variable or subroutine names like 'last' or 'record'.
484 [NamingConventions::ProhibitAmbiguousNames]
485 severity = 3
486
487 # The variable names that are not to be allowed.
488 # forbid = abstract bases close contract last left no record right second set
489
490
491 # Write `@{ $array_ref }' instead of `@$array_ref'.
492 [References::ProhibitDoubleSigils]
493 severity = 2
494
495
496 # Capture variable used outside conditional.
497 [RegularExpressions::ProhibitCaptureWithoutTest]
498 severity = 3
499
500
501 # Use `eq' or hash instead of fixed-pattern regexps.
502 [RegularExpressions::ProhibitFixedStringMatches]
503 severity = 2
504
505
506 # Use only `//' or `{}' to delimit regexps.
507 [RegularExpressions::ProhibitUnusualDelimiters]
508 severity = 1
509
510 # In addition to allowing '{}', allow '()', '[]', and '{}'.
511 # allow_all_brackets =
512
513
514 # Use `{' and `}' to delimit multi-line regexps.
515 [RegularExpressions::RequireBracesForMultiline]
516 severity = 1
517
518 # In addition to allowing '{}', allow '()', '[]', and '{}'.
519 # allow_all_brackets =
520
521
522 # Always use the `/s' modifier with regular expressions.
523 [RegularExpressions::RequireDotMatchAnything]
524 severity = 2
525
526
527 # Always use the `/x' modifier with regular expressions.
528 [RegularExpressions::RequireExtendedFormatting]
529 severity = 3
530
531 # The number of characters that a regular expression must contain before this policy will complain.
532 # Minimum value 0. No maximum.
533 # minimum_regex_length_to_complain_about = 0
534
535 # Should regexes that only contain whitespace and word characters be complained about?.
536 # strict = 0
537
538
539 # Always use the `/m' modifier with regular expressions.
540 [RegularExpressions::RequireLineBoundaryMatching]
541 severity = 2
542
543
544 # Don't call functions with a leading ampersand sigil.
545 [Subroutines::ProhibitAmpersandSigils]
546 severity = 2
547
548
549 # Don't declare your own `open' function.
550 [Subroutines::ProhibitBuiltinHomonyms]
551 severity = 2
552
553
554 # Minimize complexity by factoring code into smaller subroutines.
555 [Subroutines::ProhibitExcessComplexity]
556 severity = 4
557
558 # The maximum complexity score allowed.
559 # Minimum value 1. No maximum.
560 # max_mccabe = 20
561
562
563 # Return failure with bare `return' instead of `return undef'.
564 [Subroutines::ProhibitExplicitReturnUndef]
565 severity = 2
566
567
568 # Too many arguments.
569 [Subroutines::ProhibitManyArgs]
570 severity = 3
571
572 # The maximum number of arguments to allow a subroutine to have.
573 # Minimum value 1. No maximum.
574 # max_arguments = 5
575
576
577 # `sub never { sub correct {} }'.
578 [Subroutines::ProhibitNestedSubs]
579 severity = 5
580
581
582 # Behavior of `sort' is not defined if called in scalar context.
583 [Subroutines::ProhibitReturnSort]
584 severity = 5
585
586
587 # Don't write `sub my_function (@@) {}'.
588 [Subroutines::ProhibitSubroutinePrototypes]
589 severity = 5
590
591
592 # Prevent access to private subs in other packages.
593 [Subroutines::ProtectPrivateSubs]
594 severity = 3
595
596 # Pattern that determines what a private subroutine is.
597 # private_name_regex = \b_\w+\b
598
599 # Subroutines matching the private name regex to allow under this policy.
600 # Values that are always included: POSIX::_PC_CHOWN_RESTRICTED, POSIX::_PC_LINK_MAX, POSIX::_PC_MAX_CANON, POSIX::_PC_MAX_INPUT, POSIX::_PC_NAME_MAX, POSIX::_PC_NO_TRUNC, POSIX::_PC_PATH_MAX, POSIX::_PC_PIPE_BUF, POSIX::_PC_VDISABLE, POSIX::_POSIX_ARG_MAX, POSIX::_POSIX_CHILD_MAX, POSIX::_POSIX_CHOWN_RESTRICTED, POSIX::_POSIX_JOB_CONTROL, POSIX::_POSIX_LINK_MAX, POSIX::_POSIX_MAX_CANON, POSIX::_POSIX_MAX_INPUT, POSIX::_POSIX_NAME_MAX, POSIX::_POSIX_NGROUPS_MAX, POSIX::_POSIX_NO_TRUNC, POSIX::_POSIX_OPEN_MAX, POSIX::_POSIX_PATH_MAX, POSIX::_POSIX_PIPE_BUF, POSIX::_POSIX_SAVED_IDS, POSIX::_POSIX_SSIZE_MAX, POSIX::_POSIX_STREAM_MAX, POSIX::_POSIX_TZNAME_MAX, POSIX::_POSIX_VDISABLE, POSIX::_POSIX_VERSION, POSIX::_SC_ARG_MAX, POSIX::_SC_CHILD_MAX, POSIX::_SC_CLK_TCK, POSIX::_SC_JOB_CONTROL, POSIX::_SC_NGROUPS_MAX, POSIX::_SC_OPEN_MAX, POSIX::_SC_PAGESIZE, POSIX::_SC_SAVED_IDS, POSIX::_SC_STREAM_MAX, POSIX::_SC_TZNAME_MAX, POSIX::_SC_VERSION, POSIX::_exit.
601 # allow =
602
603
604 # Always unpack `@_' first.
605 [Subroutines::RequireArgUnpacking]
606 severity = 3
607
608 # The number of statements to allow without unpacking.
609 # Minimum value 0. No maximum.
610 # short_subroutine_statements = 0
611
612 # Should unpacking from array slices and elements be allowed?.
613 # allow_subscripts = 0
614
615 # Allow the usual delegation idiom to these namespaces/subroutines.
616 # Values that are always included: NEXT::, SUPER::.
617 # allow_delegation_to =
618
619
620 # End every path through a subroutine with an explicit `return' statement.
621 [Subroutines::RequireFinalReturn]
622 severity = 2
623
624 # The additional subroutines to treat as terminal.
625 # Values that are always included: Carp::confess, Carp::croak, confess, croak, die, exec, exit, throw.
626 # terminal_funcs =
627
628
629 # Prohibit various flavors of `no strict'.
630 [TestingAndDebugging::ProhibitNoStrict]
631 severity = 5
632
633 # Allow vars, subs, and/or refs.
634 # allow =
635
636
637 # Prohibit various flavors of `no warnings'.
638 [TestingAndDebugging::ProhibitNoWarnings]
639 severity = 4
640
641 # Permitted warning categories.
642 # allow =
643
644 # Allow "no warnings" if it restricts the kinds of warnings that are turned off.
645 # allow_with_category_restriction = 0
646
647
648 # Don't turn off strict for large blocks of code.
649 [TestingAndDebugging::ProhibitProlongedStrictureOverride]
650 severity = 4
651
652 # The maximum number of statements in a no strict block.
653 # Minimum value 1. No maximum.
654 # statements = 3
655
656
657 # Tests should all have labels.
658 [TestingAndDebugging::RequireTestLabels]
659 severity = 3
660
661 # The additional modules to require labels for.
662 # Values that are always included: Test::More.
663 # modules =
664
665
666 # Always `use strict'.
667 [TestingAndDebugging::RequireUseStrict]
668 severity = 5
669 # maximum_violations_per_document = 1
670
671 # The additional modules to treat as equivalent to "strict".
672 # Values that are always included: Moose, Moose::Role, Moose::Util::TypeConstraints, strict.
673 equivalent_modules = common::sense
674
675
676 # Always `use warnings'.
677 [TestingAndDebugging::RequireUseWarnings]
678 severity = 5
679 # maximum_violations_per_document = 1
680
681 # The additional modules to treat as equivalent to "warnings".
682 # Values that are always included: Moose, Moose::Role, Moose::Util::TypeConstraints, warnings.
683 equivalent_modules = common::sense
684
685
686 # Don't use the comma operator as a statement separator.
687 [ValuesAndExpressions::ProhibitCommaSeparatedStatements]
688 severity = 4
689
690 # Allow map and grep blocks to return lists.
691 # allow_last_statement_to_be_comma_separated_in_map_and_grep = 0
692
693
694 # Don't `use constant FOO => 15'.
695 [ValuesAndExpressions::ProhibitConstantPragma]
696 severity = 2
697
698
699 # Write `q{}' instead of `'''.
700 [ValuesAndExpressions::ProhibitEmptyQuotes]
701 severity = 2
702
703
704 # Write `"\N{DELETE}"' instead of `"\x7F"', etc.
705 [ValuesAndExpressions::ProhibitEscapedCharacters]
706 severity = 2
707
708
709 # Use concatenation or HEREDOCs instead of literal line breaks in strings.
710 [ValuesAndExpressions::ProhibitImplicitNewlines]
711 severity = 3
712
713
714 # Always use single quotes for literal strings.
715 [ValuesAndExpressions::ProhibitInterpolationOfLiterals]
716 severity = 1
717
718 # Kinds of delimiters to permit, e.g. "qq{", "qq(", "qq[", "qq/".
719 # allow =
720
721 # If the string contains ' characters, allow "" to quote it.
722 # allow_if_string_contains_single_quote = 0
723
724
725 # Write `oct(755)' instead of `0755'.
726 [ValuesAndExpressions::ProhibitLeadingZeros]
727 severity = 5
728
729 # Don't allow any leading zeros at all. Otherwise builtins that deal with Unix permissions, e.g. chmod, don't get flagged.
730 # strict = 0
731
732
733 # Long chains of method calls indicate tightly coupled code.
734 [ValuesAndExpressions::ProhibitLongChainsOfMethodCalls]
735 severity = 2
736
737 # The number of chained calls to allow.
738 # Minimum value 1. No maximum.
739 # max_chain_length = 3
740
741
742 # Don't use values that don't explain themselves.
743 [ValuesAndExpressions::ProhibitMagicNumbers]
744 severity = 2
745 # maximum_violations_per_document = 10
746
747 # Individual and ranges of values to allow, and/or "all_integers".
748 # allowed_values = 0 1 2
749
750 # Kind of literals to allow.
751 # Valid values: Binary, Exp, Float, Hex, Octal.
752 # allowed_types = Float
753
754 # Should anything to the right of a "=>" be allowed?.
755 # allow_to_the_right_of_a_fat_comma = 1
756
757
758 # Don't mix numeric operators with string operands, or vice-versa.
759 [ValuesAndExpressions::ProhibitMismatchedOperators]
760 severity = 3
761
762
763 # Write ` !$foo && $bar || $baz ' instead of ` not $foo && $bar or $baz'.
764 [ValuesAndExpressions::ProhibitMixedBooleanOperators]
765 severity = 4
766
767
768 # Use `q{}' or `qq{}' instead of quotes for awkward-looking strings.
769 [ValuesAndExpressions::ProhibitNoisyQuotes]
770 severity = 2
771
772
773 # Don't use quotes (`'', `"', ``') as delimiters for the quote-like operators.
774 [ValuesAndExpressions::ProhibitQuotesAsQuotelikeOperatorDelimiters]
775 severity = 3
776
777 # The operators to allow single-quotes as delimiters for.
778 # Valid values: m, q, qq, qr, qw, qx, s, tr, y.
779 # single_quote_allowed_operators = m s qr qx
780
781 # The operators to allow double-quotes as delimiters for.
782 # Valid values: m, q, qq, qr, qw, qx, s, tr, y.
783 # double_quote_allowed_operators =
784
785 # The operators to allow back-quotes (back-ticks) as delimiters for.
786 # Valid values: m, q, qq, qr, qw, qx, s, tr, y.
787 # back_quote_allowed_operators =
788
789
790 # Don't write ` print <<'__END__' '.
791 [ValuesAndExpressions::ProhibitSpecialLiteralHeredocTerminator]
792 severity = 4
793
794
795 # Don't use strings like `v1.4' or `1.4.5' when including other modules.
796 [ValuesAndExpressions::ProhibitVersionStrings]
797 severity = 4
798
799
800 # Warns that you might have used single quotes when you really wanted double-quotes.
801 [ValuesAndExpressions::RequireInterpolationOfMetachars]
802 severity = 1
803
804 # RCS keywords to ignore in potential interpolation.
805 # rcs_keywords =
806
807
808 # Write ` 141_234_397.0145 ' instead of ` 141234397.0145 '.
809 [ValuesAndExpressions::RequireNumberSeparators]
810 severity = 2
811
812 # The minimum absolute value to require separators in.
813 # Minimum value 10. No maximum.
814 # min_value = 10_000
815
816
817 # Write ` print <<'THE_END' ' or ` print <<"THE_END" '.
818 [ValuesAndExpressions::RequireQuotedHeredocTerminator]
819 severity = 2
820
821
822 # Write ` <<'THE_END'; ' instead of ` <<'theEnd'; '.
823 [ValuesAndExpressions::RequireUpperCaseHeredocTerminator]
824 severity = 2
825
826
827 # Do not write ` my $foo = $bar if $baz; '.
828 [Variables::ProhibitConditionalDeclarations]
829 severity = 5
830
831
832 # Use `my' instead of `local', except when you have to.
833 [Variables::ProhibitLocalVars]
834 severity = 2
835
836
837 # Avoid `$`', `$&', `$'' and their English equivalents.
838 [Variables::ProhibitMatchVars]
839 severity = 4
840
841
842 # Eliminate globals declared with `our' or `use vars'.
843 [Variables::ProhibitPackageVars]
844 severity = 3
845
846 # The base set of packages to allow variables for.
847 # packages = Data::Dumper File::Find FindBin Log::Log4perl
848
849 # The set of packages to allow variables for, in addition to those given in "packages".
850 # add_packages =
851
852
853 # Use double colon (::) to separate package name components instead of single quotes (').
854 [Variables::ProhibitPerl4PackageNames]
855 severity = 2
856
857
858 # Write `$EVAL_ERROR' instead of `$@'.
859 [Variables::ProhibitPunctuationVars]
860 severity = 1
861
862 # The additional variables to allow.
863 # Values that are always included: $1, $2, $3, $4, $5, $6, $7, $8, $9, $_, @_, _.
864 # allow =
865
866
867 # Do not reuse a variable name in a lexical scope
868 [Variables::ProhibitReusedNames]
869 severity = 3
870
871 # The variables to not consider as duplicates.
872 # allow = $self $class
873
874
875 # Don't ask for storage you don't need.
876 [Variables::ProhibitUnusedVariables]
877 severity = 3
878
879
880 # Prevent access to private vars in other packages.
881 [Variables::ProtectPrivateVars]
882 severity = 3
883
884
885 # Write `local $foo = $bar;' instead of just `local $foo;'.
886 [Variables::RequireInitializationForLocalVars]
887 severity = 3
888
889
890 # Write `for my $element (@list) {...}' instead of `for $element (@list) {...}'.
891 [Variables::RequireLexicalLoopIterators]
892 severity = 5
893
894
895 # Magic variables should be assigned as "local".
896 [Variables::RequireLocalizedPunctuationVars]
897 severity = 5
898
899 # Global variables to exclude from this policy.
900 # Values that are always included: $ARG, $_, @_.
901 allow = %ENV
902
903
904 # Negative array index should be used.
905 [Variables::RequireNegativeIndices]
906 severity = 4
907
908