# Basic setup
severity = 2
verbose = 8

# Prohibit indirect syntax of "new", "create" and "destroy"
# Should we add "connect" (DBI) as well?
[Objects::ProhibitIndirectSyntax]
severity = 4
forbid = create destroy connect

# Stop gap measure - FIXME
[RegularExpressions::RequireExtendedFormatting]
minimum_regex_length_to_complain_about = 200
[RegularExpressions::ProhibitComplexRegexes]
max_characters = 200

# PageCamel is a highly complex project. Splitting
# everything into multiple subroutines just makes matters worse
[Subroutines::ProhibitExcessComplexity]
max_mccabe = 67

# When writing commercial applications, the default is somewhat conservative
[Subroutines::ProhibitManyArgs]
max_arguments = 8

# There are a few cases where deep nests are the best alternative
# from a basket of bad possibilities
[ControlStructures::ProhibitDeepNests]
max_nests = 9

# Too brief open forces memory slurping. Not nice for files
# where the size isn't known in advance
[InputOutput::RequireBriefOpen]
lines = 20

# RCS Keywords are outdated. They mess up patch-files (see "Updating 
# FreeBSD from Source" as a prime example why NOT to use them these days)
# and they are also discouraged by the mercurial team.
#[-Perl::Critic::Policy::Miscellanea::RequireRcsKeywords]

# POD documentation has a rather low priority in this project. Set severety to the
# lowest level
[Perl::Critic::Policy::Documentation::RequirePodSections]
severity = 1

# This is a web project. HTTP status codes aren't undocumented "magic numbers", they are *very*
# well defined in RFC2612. It just doesn't make sense to use them as named variables by default. In fact,
# it might be much worse
# We also allow basic status codes (-1, 0, 1) as well as well known numbers for time intervals (24, 3600, ...)
#[ValuesAndExpressions::ProhibitMagicNumbers]
#allowed_values = -1 0 1 2 100 101 200 201 202 203 204 205 206 300 301 302 303 304 305 306 307 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 500 501 502 503 504 505 24 60 3600 86400 7 30 60 365
[-ValuesAndExpressions::ProhibitMagicNumbers]

# I disagree with this policy. If you look into the examples given by
# the manual of this very same policy, the regex are easy to read whereas
# the alternatives are jumbled character soup.
# Also performance is *not* an issue as long as you use /o
#[-Perl::Critic::Policy::RegularExpressions::ProhibitFixedStringMatches]

# I like perls matching behaviour just as it is, thank you very much
[-Perl::Critic::Policy::RegularExpressions::RequireLineBoundaryMatching]
[-RegularExpressions::RequireDotMatchAnything]

# Whats that about Conway and his dislike of PostfixControls? Sure, you
# have to be a bit carefull when and where to use them. But *i* like and use
# them because there are instances they make the code more readable to *me*.
# And since i seems to be the only one who actually does any work on this project,
# i might as well use my own styleguide...
[-ControlStructures::ProhibitPostfixControls]

# "unless" in its block form is *really* bad. Bump it up to a more
# reasonable error level
#[Perl::Critic::Policy::ControlStructures::ProhibitUnlessBlocks]
#severity = 4

# What the...? q{} is more readable than '' for empty strings??? No, not in my world.
[-ValuesAndExpressions::ProhibitEmptyQuotes]
# The same goes for "noisy" quotes
[-ValuesAndExpressions::ProhibitNoisyQuotes]

# Force "use English" to behave properly
[Perl::Critic::Policy::Modules::RequireNoMatchVarsWithUseEnglish]
severity = 4

#I like using package vars. The C++ OO model is bullsh*t in my eyes
[-Variables::ProhibitPackageVars]

# I like backticks
[-InputOutput::ProhibitBacktickOperators]

# Until the Smartmatch and given/when topics are resolved by the perl dev team, 
# i'm not switching over all my code
[ControlStructures::ProhibitCascadingIfElse]
max_elsif = 20

# Allow line breaks in strings. We use this quite a lot for SQL statements, because it makes
# copy/paste to and from pgAdmin much less error prone
[-ValuesAndExpressions::ProhibitImplicitNewlines]

# C-Style for loops are much better than the ".." operator. Implicit variables are
# an ugly, horrible idea and banned from this project for good reasons!
[-ControlStructures::ProhibitCStyleForLoops]

# I know that "fixed string matches" as regexp might be a tad slower. But sometimes they are much more readable than a bunch if string compares
[-RegularExpressions::ProhibitFixedStringMatches]

# Dont force to use "local"
[-Variables::RequireLocalizedPunctuationVars]
