dpkg (1.18.25) stretch; urgency=medium
[dpkg] / t / critic / perlcriticrc
1 ## Perl Critic configuration file
2 severity = 1
3 verbose = %f %l:%c (Severity: %s)\n %P (%s)\n near '%r'\n%d\n
4 program-extensions = .pl .t
5
6 ##
7 ## Tune tests
8 ##
9
10 [ControlStructures::ProhibitMutatingListFunctions]
11 add_list_funcs = Dpkg::Util::any Dpkg::Util::none
12
13 [RegularExpressions::ProhibitUnusualDelimiters]
14 allow_all_brackets = 1
15
16 [RegularExpressions::RequireBracesForMultiline]
17 allow_all_brackets = 1
18
19 [RegularExpressions::RequireExtendedFormatting]
20 minimum_regex_length_to_complain_about = 60
21
22 [ValuesAndExpressions::ProhibitInterpolationOfLiterals]
23 # TODO: switch these to q{} ?
24 allow_if_string_contains_single_quote = 1
25
26 ##
27 ## Disable tests
28 ##
29
30 # Complex is not always bad.
31 [-BuiltinFunctions::ProhibitComplexMappings]
32
33 # Needed when generating code.
34 [-BuiltinFunctions::ProhibitStringyEval]
35
36 # FIXME: Bogus check.
37 [-Documentation::PodSpelling]
38
39 # While this might be good for performance, it is bad for keeping docs updated.
40 [-Documentation::RequirePodAtEnd]
41
42 # FIXME: Bogus check.
43 [-Documentation::RequirePodLinksIncludeText]
44
45 # TODO: Standardize sections, but the ones from this are not usable.
46 [-Documentation::RequirePodSections]
47
48 # Too many false positives.
49 [-CodeLayout::RequireTidyCode]
50
51 # Forcing this just turns into noise (depending on the context, it makes sense).
52 [-CodeLayout::RequireTrailingCommas]
53
54 # These are fine.
55 [-ControlStructures::ProhibitCascadingIfElse]
56
57 # These are fine, too many in the code base anyway.
58 [-ControlStructures::ProhibitPostfixControls]
59
60 # These are fine, usually as long as they are not double negations.
61 [-ControlStructures::ProhibitUnlessBlocks]
62
63 # FIXME: Too many false positives.
64 [-ControlStructures::ProhibitUnreachableCode]
65
66 # TODO: Check it out, add new Dpkg::Program module?
67 [-InputOutput::ProhibitBacktickOperators]
68
69 # Needed, using <>/<@ARGV> is not correct, Prompt is not a core module.
70 [-InputOutput::ProhibitExplicitStdin]
71
72 # TODO: Maybe, some of these are part of the public/current API.
73 [-Modules::ProhibitAutomaticExportation]
74
75 # Complex is not always bad.
76 [-Modules::ProhibitExcessMainComplexity]
77
78 # FIXME: Too many false positives; non-modules all trigger.
79 [-Modules::RequireVersionVar]
80
81 # These are fine.
82 [-NamingConventions::ProhibitAmbiguousNames]
83
84 # We work primarily with ASCII, so we need to specify the exact characters
85 # to match.
86 [-RegularExpressions::ProhibitEnumeratedClasses]
87
88 # When . is used in the code it means what it does.
89 [-RegularExpressions::RequireDotMatchAnything]
90
91 # When ^ or $ are used in the code they mean what they do.
92 [-RegularExpressions::RequireLineBoundaryMatching]
93
94 # TODO: While valid, these are part of the public/current API.
95 [-Subroutines::ProhibitBuiltinHomonyms]
96
97 # Needed.
98 [-Subroutines::ProhibitSubroutinePrototypes]
99
100 # Adding these seems like more noise.
101 [-Subroutines::RequireFinalReturn]
102
103 # Readers need to know perl, English module is worse.
104 [-Variables::ProhibitPunctuationVars]
105
106 # Readers need to know perl.
107 [-Variables::RequireInitializationForLocalVars]
108
109 # FIXME: Too many false positives; on ::main and for $ENV, $SIG, $?, $a, $b.
110 [-Variables::RequireLocalizedPunctuationVars]
111
112 # Readonly is not a core module.
113 [-ValuesAndExpressions::ProhibitConstantPragma]
114
115 # TODO: Check it out, using other quotes might be less readable and uniform.
116 [-ValuesAndExpressions::ProhibitEmptyQuotes]
117
118 # Used for help output.
119 [-ValuesAndExpressions::ProhibitImplicitNewlines]
120
121 # Octals are fine.
122 [-ValuesAndExpressions::ProhibitLeadingZeros]
123
124 # TODO: Check it out, some magic numbers are fine, octals for example.
125 [-ValuesAndExpressions::ProhibitMagicNumbers]
126
127 # FIXME: False positives on long hex numbers, even when separated.
128 [-ValuesAndExpressions::RequireNumberSeparators]