severity = 3

# This only makes sense for object-oriented code
[ValuesAndExpressions::ProhibitAccessOfPrivateData]
severity = 1

###
### Turn off policies
### either because they're actively harmful
### or not helpful enough to be worth it
###

# Perltidy generates commented out code in closing side comments
[-Bangs::ProhibitCommentedOutCode]

# foo() if $bar; often makes more sense
[-ControlStructures::ProhibitPostfixControls]

# The idea that inline POD slows compilation is a myth
[-Documentation::RequirePodAtEnd]

# Don't require emacs
[-Editor::RequireEmacsFileVariables]

# Git doesn't have these. And they're rarely practical anyway.
[-Miscellanea::RequireRcsKeywords]

# Don't attempt to comply with OTRS policies
[-OTRS]

# @$foo easier to read and type than @{$foo}
[-References::ProhibitDoubleSigils]

# Version strings are standard since Perl 5.6
[-ValuesAndExpressions::ProhibitVersionStrings]

###
### Configure policies
###

# No tabs ever
[CodeLayout::ProhibitHardTabs]
allow_leading_tabs = 0

# No point putting a /x on really short regexes.
[RegularExpressions::RequireExtendedFormatting]
minimum_regex_length_to_complain_about = 5

# Extend the ability to play with @_ to 3 line subroutines.
[Subroutines::RequireArgUnpacking]
short_subroutine_statements = 3

# "no strict 'refs'" is necessary. The rest you don't need.
[TestingAndDebugging::ProhibitNoStrict]
allow = refs

# "no warnings 'foo'" is fine
[TestingAndDebugging::ProhibitNoWarnings]
allow_with_category_restriction = 1

# Inform perlcritic that Mouse turns on strictures
[TestingAndDebugging::RequireUseStrict]
equivalent_modules = Mouse perl5i::0 perl5i::1 perl5i::2 Modern::Perl

[TestingAndDebugging::RequireUseWarnings]
equivalent_modules = Mouse perl5i::0 perl5i::1 perl5i::2 Modern::Perl

# Some modules define a package variable as part of their interface
[Variables::ProhibitPackageVars]
add_packages = Module::CoreList

# $! and $@ are very common and English is a pain to use right
[Variables::ProhibitPunctuationVars]
allow = $@ $!

###
### Increase severity of some things
###

[Perl::Critic::Policy::CodeLayout::ProhibitTrailingWhitespace]
severity = 4
