1 ## Perl Critic configuration file
3 verbose = %f %l:%c (Severity: %s)\n %P (%s)\n near '%r'\n%d\n
4 program-extensions = .pl .t
10 [Documentation::RequirePodSections]
11 lib_sections = NAME | DESCRIPTION | CHANGES
12 script_sections = NAME | SYNOPSIS | DESCRIPTION
14 [InputOutput::ProhibitBacktickOperators]
15 # TODO: Add new Dpkg::Program module and switch those to it ?
16 only_in_void_context = 1
18 [NamingConventions::ProhibitAmbiguousNames]
19 # Allow set(), which is the common name for a setter.
20 forbid = abstract bases close contract last left no record right second
22 [RegularExpressions::ProhibitUnusualDelimiters]
23 allow_all_brackets = 1
25 [RegularExpressions::RequireBracesForMultiline]
26 allow_all_brackets = 1
28 [RegularExpressions::RequireExtendedFormatting]
29 minimum_regex_length_to_complain_about = 60
31 [Subroutines::RequireArgUnpacking]
32 allow_delegation_to = new clone
34 [ValuesAndExpressions::ProhibitInterpolationOfLiterals]
35 # TODO: Switch these to q{} ?
36 allow_if_string_contains_single_quote = 1
42 # Here complex is meant as long, but long is not necessarily complex.
43 [-BuiltinFunctions::ProhibitComplexMappings]
45 # Needed when generating code.
46 [-BuiltinFunctions::ProhibitStringyEval]
49 [-Documentation::PodSpelling]
51 # While this might be good for performance, it is bad for keeping docs updated.
52 [-Documentation::RequirePodAtEnd]
54 # Too many false positives.
55 [-CodeLayout::RequireTidyCode]
57 # Forcing this just turns into noise (depending on the context, it makes sense).
58 [-CodeLayout::RequireTrailingCommas]
60 # These are fine, and given/when are marked as experimental.
61 [-ControlStructures::ProhibitCascadingIfElse]
63 # These are fine, and too many in the code base anyway.
64 [-ControlStructures::ProhibitPostfixControls]
66 # These are fine, usually as long as they are not double negations.
67 [-ControlStructures::ProhibitUnlessBlocks]
69 # BUG: Too many false positives.
70 [-ControlStructures::ProhibitUnreachableCode]
72 # Not relevant anymore, the mentioned problems were fixed in Perl 5.14.
73 [-ErrorHandling::RequireCheckingReturnValueOfEval]
75 # Needed, using <>/<@ARGV> is not correct, Prompt is not a core module.
76 [-InputOutput::ProhibitExplicitStdin]
78 # TODO: Maybe, some of these are part of the public/current API.
79 [-Modules::ProhibitAutomaticExportation]
81 # Here complex is meant as long, but long is not necessarily complex.
82 [-Modules::ProhibitExcessMainComplexity]
84 # BUG: Too many false positives; non-modules all trigger.
85 [-Modules::RequireVersionVar]
87 # We work primarily with ASCII, so we need to specify the exact characters
89 [-RegularExpressions::ProhibitEnumeratedClasses]
91 # When . is used in the code it means what it does.
92 [-RegularExpressions::RequireDotMatchAnything]
94 # When ^ or $ are used in the code they mean what they do.
95 [-RegularExpressions::RequireLineBoundaryMatching]
97 # TODO: While valid, these are part of the public/current API.
98 [-Subroutines::ProhibitBuiltinHomonyms]
100 # TODO: Needed but we should switch away, and with perl 5.36 use signatures.
101 [-Subroutines::ProhibitSubroutinePrototypes]
103 # Adding these seems like more noise.
104 [-Subroutines::RequireFinalReturn]
106 # Readers need to know perl, English module is worse.
107 [-Variables::ProhibitPunctuationVars]
108 [-Modules::RequireNoMatchVarsWithUseEnglish]
110 # Readers need to know perl.
111 [-Variables::RequireInitializationForLocalVars]
113 # BUG: Too many false positives; on ::main and for $ENV, $SIG, $?, $a, $b.
114 [-Variables::RequireLocalizedPunctuationVars]
116 # Readonly is not a core module.
117 [-ValuesAndExpressions::ProhibitConstantPragma]
119 # TODO: Check it out, using other quotes might be less readable and uniform.
120 [-ValuesAndExpressions::ProhibitEmptyQuotes]
122 # Using charnames is less clear.
123 [-ValuesAndExpressions::ProhibitEscapedCharacters]
125 # Used for help output.
126 [-ValuesAndExpressions::ProhibitImplicitNewlines]
128 # TODO: Octals are fine, but revisit with perl 5.34 octal syntax 0o<nnnn>.
129 [-ValuesAndExpressions::ProhibitLeadingZeros]
131 # TODO: Check it out, some magic numbers are fine, octals for example.
132 [-ValuesAndExpressions::ProhibitMagicNumbers]
134 # BUG: False positives on long hex numbers, even when separated.
135 [-ValuesAndExpressions::RequireNumberSeparators]