-
Notifications
You must be signed in to change notification settings - Fork 0
/
.perlcriticrc
140 lines (96 loc) · 3.3 KB
/
.perlcriticrc
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
# global perlcritic configuration
#
# nice output, to easily see the POD of the policy
verbose = [%p] %m at %f line %l, near '%r'\n
# severity of 3 is a good start (1 is very strict, 5 very tolerant)
severity = 3
# We don't check for perl tidyness because we run perltidy in the git
# pre-commit hook anyway.
[Subroutines::ProhibitExcessComplexity]
severity = 5
# Regexps
#
# we want to use // without //ms
[-RegularExpressions::RequireDotMatchAnything]
[-RegularExpressions::RequireLineBoundaryMatching]
[-RegularExpressions::RequireExtendedFormatting]
minimum_regex_length_to_complain_about = 5
[-RegularExpressions::ProhibitComplexRegexes]
# Documentation
#
# we don't want these POD rules
[-Documentation::RequirePodSections]
# We don't care about POD links
[-Documentation::RequirePodLinksIncludeText]
# Variables
#
# we use $@ and $!
[-Variables::ProhibitPunctuationVars]
# We want to be able to use Carp::Verbose in our tests scripts, so
# we add Carp to the whitelist
[Variables::ProhibitPackageVars]
packages = Data::Dumper File::Find FindBin Log::Log4perl Carp
# Values & Expressions
#
[-ValuesAndExpressions::ProhibitEmptyQuotes]
# I really don't think q{/} is more readable than '/'...
[-ValuesAndExpressions::ProhibitNoisyQuotes]
# Perl::Critic recommends Readonly, but this IS BAD!
# we use Const::Fast instead, but this policy keeps poping up.
[-ValuesAndExpressions::ProhibitMagicNumbers]
# want to be able to do :
#
# defined $label && length($label)
# or croak("label can't be empty")
#
[-ValuesAndExpressions::ProhibitMixedBooleanOperators]
# Modules
#
# we want to be able to build DSLs
[-Modules::ProhibitAutomaticExportation]
# We only want the main module to provide $VERSION
[-Modules::RequireVersionVar]
# Subroutines
#
# we want to be able to define short getters
[-Subroutines::RequireFinalReturn]
# we cant do @_ mesures with that one
[-Subroutines::RequireArgUnpacking]
# name is a common used name for methods
# but forbidden by this policy ...
[-Subroutines::ProhibitBuiltinHomonyms]
# some old libs use many args, we don't want to block that for now
[-Subroutines::ProhibitManyArgs]
# we allo protected subs
[-Subroutines::ProhibitUnusedPrivateSubroutines]
# Miscellanea
#
# We're not under CVS! :)
[-Miscellanea::RequireRcsKeywords]
[TestingAndDebugging::ProhibitNoStrict]
allow = refs
[TestingAndDebugging::ProhibitNoWarnings]
allow = redefine prototype
[TestingAndDebugging::RequireUseStrict]
equivalent_modules = Weborama::Standard Test::Most Test::Class::Most Dancer strictures Moo Moo::Role
[TestingAndDebugging::RequireUseWarnings]
equivalent_modules = Weborama::Standard Test::Most Test::Class::Most Dancer strictures Moo Moo::Role
# ControlStructures
#
# we use postifx controls
[-ControlStructures::ProhibitPostfixControls]
# we cant use the switch feature, because some code is deployed
# under Perl 5.8, so we allow if/elsif/else
[-ControlStructures::ProhibitCascadingIfElse]
# ErrorHandling
#
# this one involves complex code structures, we'll switch to Try::Tiny
# soon/
[-ErrorHandling::RequireCheckingReturnValueOfEval]
# We want to use croak everywhere instead of die
[ErrorHandling::RequireCarping]
# allow backtick if capture result
[InputOutput::ProhibitBacktickOperators]
only_in_void_context = 1
# allow constant pragma
[-ValuesAndExpressions::ProhibitConstantPragma]