# -*- 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 $!

