Debian Codegraph @

t/perlcriticrc

raw
1 # Basic setup
2 severity = 3
3 verbose = 8
4
5 # Prohibit indirect syntax of "new", "create" and "destroy"
6 # Should we add "connect" (DBI) as well?
7 [Objects::ProhibitIndirectSyntax]
8 severity = 4
9 forbid = create destroy connect
10
11 # Stop gap measure - FIXME
12 [RegularExpressions::RequireExtendedFormatting]
13 minimum_regex_length_to_complain_about = 40
14
15 # Maplat is a highly complex project. Splitting
16 # everything into multiple subroutines just makes matters worse
17 [Subroutines::ProhibitExcessComplexity]
18 max_mccabe = 67
19
20 # This policy would force constructs that will prohibit simple
21 # copy&paste (used in all the SQL strings where c&p between perl code and some SQL
22 # window are the most efficient form of editing.
23 # The alternative would be HEREDOC's. They will break the code flow and are more
24 # akward to implement. I'll maybe do this later... for now, just use implicit newlines
25 # because they get ignored by the SQL parsers anyway...
26 #
27 # So we don't forget, we set a severety level that's not yet checked
28 [Perl::Critic::Policy::ValuesAndExpressions::ProhibitImplicitNewlines]
29 severity = 2
30
31 # When writing commercial applications, the default is somewhat conservative
32 [Subroutines::ProhibitManyArgs]
33 max_arguments = 8
34
35 # There are a few cases where deep nests are the best alternative
36 # from a basket of bad possibilities
37 [ControlStructures::ProhibitDeepNests]
38 max_nests = 9
39
40 # Too brief open forces memory slurping. Not nice for files
41 # where the size isn't known in advance
42 [InputOutput::RequireBriefOpen]
43 lines = 20
44
45 # RCS Keywords are outdated. They mess up patch-files (see "Updating
46 # FreeBSD from Source" as a prime example why NOT to use them these days)
47 # and they are also discouraged by the mercurial team.
48 [-Perl::Critic::Policy::Miscellanea::RequireRcsKeywords]
49
50 # POD documentation has a rather low priority in this project. Set severety to the
51 # lowest level
52 [Perl::Critic::Policy::Documentation::RequirePodSections]
53 severity = 1
54
55 # This is a web project. HTTP status codes aren't undocumented "magic numbers", they are *very*
56 # well defined in RFC2612. It just doesn't make sense to use them as named variables by default. In fact,
57 # it might be much worse
58 [ValuesAndExpressions::ProhibitMagicNumbers]
59 allowed_values = 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
60
61 # I disagree with this policy. If you look into the examples given by
62 # the manual of this very same policy, the regex are easy to read whereas
63 # the alternatives are jumbled character soup.
64 # Also performance is *not* an issue as long as you use /o
65 #[-Perl::Critic::Policy::RegularExpressions::ProhibitFixedStringMatches]
66
67 # I like perls matching behaviour just as it is, thank you very much
68 [-Perl::Critic::Policy::RegularExpressions::RequireLineBoundaryMatching]
69 [-RegularExpressions::RequireDotMatchAnything]
70
71 # Whats that about Conway and his dislike of PostfixControls? Sure, you
72 # have to be a bit carefull when and where to use them. But *i* like and use
73 # them because there are instances they make the code more readable to *me*.
74 # And since i seems to be the only one who actually does any work on this project,
75 # i might as well use my own styleguide...
76 #[-ControlStructures::ProhibitPostfixControls]
77
78 # "unless" in its block form is *really* bad. Bump it up to a more
79 # reasonable error level
80 #[Perl::Critic::Policy::ControlStructures::ProhibitUnlessBlocks]
81 #severity = 4
82
83 # What the...? q{} is more readable than '' for empty strings??? No, not in my world.
84 [-ValuesAndExpressions::ProhibitEmptyQuotes]
85 # The same goes for "noisy" quotes
86 [-ValuesAndExpressions::ProhibitNoisyQuotes]
87
88 # Force "use English" to behave properly
89 [Perl::Critic::Policy::Modules::RequireNoMatchVarsWithUseEnglish]
90 severity = 4