summaryrefslogtreecommitdiff
path: root/.perlcriticrc
blob: 5e66634218b2f54de0cd6bd2b21c074b5f9a899e (plain)
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
# -*- conf -*-
# FIXME: the list of checks should probably be moved to
# t/scripts/critic.pl. Line continuations are not supported here

verbose = 1
# Severity is actually ignored for our main purposes, see below
severity = 1
# Work based on a whitelist
only = 1
# Our whitelist (ignores severity):
include = ExplicitReturnUndef GlobFunction NegativeIndices PrivateVars UselessInitialization MatchVars NumberSeparators NullStatements LongChainsOfMethodCalls UseStrict UseWarnings EndWithOne ConditionalUseStatements PackageMatchesPodName JoinedReadline UnreachableCode TrailingWhitespace InterpolationOfLiterals ImplicitNewlines CommaSeparatedStatements UseStrict UseWarnings UnusedVariables UnusedCapture TwoArgOpen ProhibitHardTabs MismatchedOperators IndirectSyntax Modules:: BuiltinFunctions:: ClassHierarchies:: CommaSeparatedStatements QuotesAsQuotelikeOperatorDelimiters MixedBooleanOperators ProhibitBarewordFileHandles
#include = MixedBooleanOperators InteractiveTest UpperCaseHeredoc ReusedNames PackageVars ConditionalDeclarations SingleCharAlternation FixedStringMatches ConditionalUseStatements QuotedWordLists

exclude = RequireFilenameMatchesPackage RequireVersionVar ProhibitExcessMainComplexity ProhibitStringySplit ComplexMappings StringyEval

# If you want to try some other stuff, uncomment the following
# (exclude is an incomplete list of things we probably won't change)
# theme = security || bugs || complexity || maintenance
# exclude = ExtendedFormat LineBoundaryMatch DotMatchAnything AutomaticExportation BuiltinHomonyms FinalReturn PunctuationVars InitializationForLocalVars UnusualDelimiters RcsKeywords
# even more stuff if theme is empty

# Would be nice to fix at some point:
# include = ProhibitBarewordFileHandles

criticism-fatal = 1
color = 1
allow-unsafe = 1

[BuiltinFunctions::ProhibitBooleanGrep]

[InputOutput::RequireCheckedSyscalls]
functions = open opendir chdir read readline closedir sysopen sysread sysclose close
# possible TODO read readline readdir close closedir

# We don't use package versions atm.
[-Modules::RequireVersionVar]
[-Modules::ProhibitExcessMainComplexity]

[ValuesAndExpressions::ProhibitInterpolationOfLiterals]
allow_if_string_contains_single_quote = 1

[ValuesAndExpressions::ProhibitCommaSeparatedStatements]
allow_last_statement_to_be_comma_separated_in_map_and_grep = 1

[-ValuesAndExpressions::ProhibitConstantPragma]

[Variables::RequireLocalizedPunctuationVars]
allow = %ENV %SIG $!