| 1 |
# -*- conf -*- |
| 2 |
# |
| 3 |
# Default configuration for perlcritic. Be sure to copy this into the source |
| 4 |
# for packages that run perlcritic tests automatically during the build for |
| 5 |
# reproducible test results. |
| 6 |
# |
| 7 |
# This file has been updated to match perlcritic 1.118. |
| 8 |
# |
| 9 |
# The canonical version of this file is maintained in the rra-c-util package, |
| 10 |
# which can be found at <http://www.eyrie.org/~eagle/software/rra-c-util/>. |
| 11 |
# |
| 12 |
# Written by Russ Allbery <[email protected]> |
| 13 |
# Copyright 2011, 2012, 2013 |
| 14 |
# The Board of Trustees of the Leland Stanford Junior University |
| 15 |
# |
| 16 |
# Permission is hereby granted, free of charge, to any person obtaining a |
| 17 |
# copy of this software and associated documentation files (the "Software"), |
| 18 |
# to deal in the Software without restriction, including without limitation |
| 19 |
# the rights to use, copy, modify, merge, publish, distribute, sublicense, |
| 20 |
# and/or sell copies of the Software, and to permit persons to whom the |
| 21 |
# Software is furnished to do so, subject to the following conditions: |
| 22 |
# |
| 23 |
# The above copyright notice and this permission notice shall be included in |
| 24 |
# all copies or substantial portions of the Software. |
| 25 |
# |
| 26 |
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| 27 |
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 28 |
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL |
| 29 |
# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
| 30 |
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING |
| 31 |
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER |
| 32 |
# DEALINGS IN THE SOFTWARE. |
| 33 |
|
| 34 |
severity = 1 |
| 35 |
verbose = %f:%l:%c: [%p] %m (%e, Severity: %s)\n |
| 36 |
|
| 37 |
# I prefer this policy (a lot, actually), but other people in my group at |
| 38 |
# Stanford really didn't like it, so this is my compromise to agree with a |
| 39 |
# group coding style. |
| 40 |
[-CodeLayout::ProhibitParensWithBuiltins] |
| 41 |
|
| 42 |
# Stanford's coding style allows postfix unless for flow control. There |
| 43 |
# doesn't appear to be any way to allow it only for flow control (the logic |
| 44 |
# for "if" and "when" appears to be special-cased), so we have to allow unless |
| 45 |
# globally. |
| 46 |
[ControlStructures::ProhibitPostfixControls] |
| 47 |
allow = unless |
| 48 |
|
| 49 |
# This is handled with a separate test case that uses Test::Spelling. |
| 50 |
[-Documentation::PodSpelling] |
| 51 |
|
| 52 |
# Pod::Man and Pod::Text fixed this bug years ago. I know, I maintain them. |
| 53 |
[-Documentation::RequirePodLinksIncludeText] |
| 54 |
|
| 55 |
# The POD sections Perl::Critic wants are incompatible with the POD template |
| 56 |
# from perlpodstyle, which is what I use for my POD documentation. |
| 57 |
[-Documentation::RequirePodSections] |
| 58 |
|
| 59 |
# This problem was fixed in Perl 5.14, which now properly preserves the value |
| 60 |
# of $@ even if destructors run at exit from the eval block. |
| 61 |
[-ErrorHandling::RequireCheckingReturnValueOfEval] |
| 62 |
|
| 63 |
# The default of 9 is too small and forces weird code contortions. |
| 64 |
[InputOutput::RequireBriefOpen] |
| 65 |
lines = 25 |
| 66 |
|
| 67 |
# This is correct 80% of the time, but it isn't correct for a lot of scripts |
| 68 |
# inside packages, where maintaining $VERSION isn't worth the effort. |
| 69 |
# Unfortunately, there's no way to override it, so it gets turned off |
| 70 |
# globally. |
| 71 |
[-Modules::RequireVersionVar] |
| 72 |
|
| 73 |
# This sounds interesting but is actually useless. Any large blocks of |
| 74 |
# literal text, which does not add to the complexity of the regex, will set it |
| 75 |
# off. |
| 76 |
[-RegularExpressions::ProhibitComplexRegexes] |
| 77 |
|
| 78 |
# I generally don't want to require Readonly as a prerequisite for all my Perl |
| 79 |
# modules. |
| 80 |
[-ValuesAndExpressions::ProhibitConstantPragma] |
| 81 |
|
| 82 |
# A good idea, but there are too many places where this would be more |
| 83 |
# confusing than helpful. Pull out numbers if one might change them |
| 84 |
# independent of the algorithm, but don't do so for mathematical formulae. |
| 85 |
[-ValuesAndExpressions::ProhibitMagicNumbers] |
| 86 |
|
| 87 |
# Increase this to six digits so that I'm not told to add underscores to |
| 88 |
# port numbers (which is just silly). |
| 89 |
[ValuesAndExpressions::RequireNumberSeparators] |
| 90 |
min_value = 100000 |
| 91 |
|
| 92 |
# Text::Wrap has a broken interface that requires use of package variables. |
| 93 |
[Variables::ProhibitPackageVars] |
| 94 |
add_packages = Text::Wrap |
| 95 |
|
| 96 |
# use English was one of the worst ideas in the history of Perl. It makes the |
| 97 |
# code slightly more readable for amateurs at the cost of confusing |
| 98 |
# experienced Perl programmers and sending people in futile quests for where |
| 99 |
# these magical global variables are defined. |
| 100 |
[-Variables::ProhibitPunctuationVars] |