-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy path.perlcriticrc
More file actions
137 lines (106 loc) · 4.13 KB
/
Copy path.perlcriticrc
File metadata and controls
137 lines (106 loc) · 4.13 KB
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
# print the policy name as well as the normal output
verbose = %f: %m at line %l, column %c. %e. ([%p] Severity: %s)\n
# sev 5
# tl;dr - return undef returns (undef) instead of () in list context
# bare return returns undef in scalar context and () in list context
# so use that instead
# [-Subroutines::ProhibitExplicitReturnUndef]
# legitimate uses of stringy eval are now marked with no critic
#[-BuiltinFunctions::ProhibitStringyEval]
# we're enforcing this now
# [-InputOutput::ProhibitTwoArgOpen]
# allow 'require "filename";'
[-Modules::RequireBarewordIncludes]
# sev 4
# this one is silly and horribly named. Even if I have a local copy of the
# value e.g. %ENV a later assignment of a value in there gets the error
# so just disable.
[-Variables::RequireLocalizedPunctuationVars]
# allow 'no warnings qw(once)
[TestingAndDebugging::ProhibitNoWarnings]
allow = once
# we enforce this one now too
#[-Subroutines::RequireFinalReturn]
# these two are pretty silly and I doubt we'll ever enforce them
[-InputOutput::RequireBriefOpen]
[-Subroutines::RequireArgUnpacking]
# from perl-critic-more - don't require use of exceptions
[-ErrorHandling::RequireUseOfExceptions ]
# sev 3
# server only - recheck this at some stage
[-CodeLayout::ProhibitHardTabs ]
# don't require all regexes to use /x
[-RegularExpressions::RequireExtendedFormatting]
# allow use of 'our' and 'use vars'
[-Variables::ProhibitPackageVars]
# allow 'die' and 'warn' instead of croak/carp
[-ErrorHandling::RequireCarping]
# it doesn't like our version strings, but they should really be fine
[-ValuesAndExpressions::ProhibitComplexVersion]
# allow capturing output from backticks
[InputOutput::ProhibitBacktickOperators]
only_in_void_context = 1
# don't worry about large main sections
[-Modules::ProhibitExcessMainComplexity]
# ditto subroutines
[-Subroutines::ProhibitExcessComplexity]
# allow newlines in qq{}
[-ValuesAndExpressions::ProhibitImplicitNewlines]
# allow lots of elsif clauses
[-ControlStructures::ProhibitCascadingIfElse]
# allow negations in until and unless
[-ControlStructures::ProhibitNegativeExpressionsInUnlessAndUntilConditions]
# don't worry about this for now - possibly revisit later
[-ErrorHandling::RequireCheckingReturnValueOfEval ]
# allow multi-statement map blocks
[-BuiltinFunctions::ProhibitComplexMappings]
## Our aim is currently to comply down to sev 3.
## Below are the policies that we don't comply with at levels 2 and 1.
## In most cases we don't care and have no interest in complying.
## Since we're not checking below 3 they are commented out for now.
## sev 2
#
#[-RegularExpressions::RequireLineBoundaryMatching]
#[-RegularExpressions::RequireDotMatchAnything]
#[-ValuesAndExpressions::ProhibitMagicNumbers]
#[-Documentation::RequirePodSections]
#[-ValuesAndExpressions::ProhibitNoisyQuotes]
#[-ValuesAndExpressions::ProhibitEmptyQuotes]
#[-BuiltinFunctions::ProhibitBooleanGrep]
#[-ControlStructures::ProhibitPostfixControls]
#[-Variables::ProhibitPunctuationVars]
#[-ControlStructures::ProhibitUnlessBlocks]
#[-References::ProhibitDoubleSigils]
#[-BuiltinFunctions::ProhibitUselessTopic]
#[-Subroutines::ProhibitAmpersandSigils]
#[-RegularExpressions::ProhibitFixedStringMatches]
#
## should probably fix these
#[-InputOutput::RequireCheckedClose]
#
#
# I'd like to be able to disable this on just the build-farm.conf.sample
# but perlcritic doesn't provide a way to do that in the config file
# and I'd rather not put the no critic annotation on line 1 which is
# where it would have to go.
#[-Modules::RequireVersionVar]
## sev 1
#
#[-ValuesAndExpressions::RequireInterpolationOfMetachars]
#
## just might be worth looking at
#[-ValuesAndExpressions::ProhibitInterpolationOfLiterals]
#
#[-RegularExpressions::ProhibitUnusualDelimiters]
#[-Documentation::RequirePodAtEnd]
#[-RegularExpressions::ProhibitEscapedMetacharacters]
#[-CodeLayout::ProhibitParensWithBuiltins]
#[-InputOutput::RequireBracedFileHandleWithPrint]
#[-CodeLayout::RequireTrailingCommas]
#[-NamingConventions::Capitalization]
#[-RegularExpressions::ProhibitEnumeratedClasses]
#[-RegularExpressions::RequireBracesForMultiline]
#
## check these too some time
#[-InputOutput::RequireCheckedSyscalls]
#