severity = 3
verbose = 11
program-extensions = pl psgi t pm

#
# Configure these behaviors
#
[CognitiveComplexity::ProhibitExcessCognitiveComplexity]
info_level = 15
warn_level = 25

[InputOutput::RequireCheckedSyscalls]
functions = :builtins
exclude_functions = sleep print close

[RegularExpressions::ProhibitComplexRegexes]
max_characters = 200

[Subroutines::ProhibitExcessComplexity]
max_mccabe = 25

[TestingAndDebugging::ProhibitNoStrict]
allow = refs

[TestingAndDebugging::ProhibitNoWarnings]
allow = redefine

[TestingAndDebugging::RequireUseStrict]
equivalent_modules = Modern::Perl Test2::V1

[TestingAndDebugging::RequireUseWarnings]
equivalent_modules = Modern::Perl Test2::V1

[ValuesAndExpressions::ProhibitInterpolationOfLiterals]
allow_if_string_contains_single_quote = 1

[Variables::ProhibitPackageVars]
add_packages = Carp Test::Builder

# Moo/Moo::Role and Dancer2::Plugin install these via typeglob munging
# rather than Exporter, so this Policy can't see them as imported. Carp's
# default export list and tag-based imports (e.g. UUID::Tiny's :std) aren't
# resolved by this Policy either.
[Subroutines::ProhibitCallsToUndeclaredSubs]
exempt_subs = Moo::has Moo::with Moo::Role::has Moo::Role::with Moo::Role::requires Dancer2::Plugin::has Dancer2::Plugin::with Dancer2::Plugin::plugin_keywords Dancer2::Plugin::plugin_hooks Carp::croak Carp::carp Carp::confess Carp::cluck UUID::Tiny::create_uuid_as_string UUID::Tiny::UUID_V4

# Moo lazy-attribute builders (_build_foo) are invoked reflectively by Moo,
# not called directly in the file that declares them.
[Subroutines::ProhibitUnusedPrivateSubroutines]
allow_name_regex = _build_\w+

#
# Turn these off!
#

# This incorrectly thinks signatures are prototypes.
[-Subroutines::ProhibitSubroutinePrototypes]

# No need for /xsm everywhere
[-RegularExpressions::RequireDotMatchAnything]
[-RegularExpressions::RequireExtendedFormatting]
[-RegularExpressions::RequireLineBoundaryMatching]

# http://stackoverflow.com/questions/2275317/why-does-perlcritic-dislike-using-shift-to-populate-subroutine-variables
[-Subroutines::RequireArgUnpacking]

# Explicitly returning undef is a _good_ thing in many cases, since it
# prevents very common errors when using a sub in list context to construct a
# hash and ending up with a missing value or key.
[-Subroutines::ProhibitExplicitReturnUndef]

