|
Packit |
e6c7a3 |
# -*- conf -*-
|
|
Packit |
e6c7a3 |
#
|
|
Packit |
e6c7a3 |
# Default configuration for perlcritic. Be sure to copy this into the source
|
|
Packit |
e6c7a3 |
# for packages that run perlcritic tests automatically during the build for
|
|
Packit |
e6c7a3 |
# reproducible test results.
|
|
Packit |
e6c7a3 |
#
|
|
Packit |
e6c7a3 |
# This file has been updated to match perlcritic 1.118.
|
|
Packit |
e6c7a3 |
#
|
|
Packit |
e6c7a3 |
# The canonical version of this file is maintained in the rra-c-util package,
|
|
Packit |
e6c7a3 |
# which can be found at <https://www.eyrie.org/~eagle/software/rra-c-util/>.
|
|
Packit |
e6c7a3 |
#
|
|
Packit |
e6c7a3 |
# Written by Russ Allbery <eagle@eyrie.org>
|
|
Packit |
e6c7a3 |
# Copyright 2011, 2012, 2013
|
|
Packit |
e6c7a3 |
# The Board of Trustees of the Leland Stanford Junior University
|
|
Packit |
e6c7a3 |
#
|
|
Packit |
e6c7a3 |
# Permission is hereby granted, free of charge, to any person obtaining a
|
|
Packit |
e6c7a3 |
# copy of this software and associated documentation files (the "Software"),
|
|
Packit |
e6c7a3 |
# to deal in the Software without restriction, including without limitation
|
|
Packit |
e6c7a3 |
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
|
Packit |
e6c7a3 |
# and/or sell copies of the Software, and to permit persons to whom the
|
|
Packit |
e6c7a3 |
# Software is furnished to do so, subject to the following conditions:
|
|
Packit |
e6c7a3 |
#
|
|
Packit |
e6c7a3 |
# The above copyright notice and this permission notice shall be included in
|
|
Packit |
e6c7a3 |
# all copies or substantial portions of the Software.
|
|
Packit |
e6c7a3 |
#
|
|
Packit |
e6c7a3 |
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
Packit |
e6c7a3 |
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
Packit |
e6c7a3 |
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
|
Packit |
e6c7a3 |
# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
Packit |
e6c7a3 |
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
Packit |
e6c7a3 |
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
|
Packit |
e6c7a3 |
# DEALINGS IN THE SOFTWARE.
|
|
Packit |
e6c7a3 |
|
|
Packit |
e6c7a3 |
severity = 1
|
|
Packit |
e6c7a3 |
verbose = %f:%l:%c: [%p] %m (%e, Severity: %s)\n
|
|
Packit |
e6c7a3 |
|
|
Packit |
e6c7a3 |
# I prefer this policy (a lot, actually), but other people in my group at
|
|
Packit |
e6c7a3 |
# Stanford really didn't like it, so this is my compromise to agree with a
|
|
Packit |
e6c7a3 |
# group coding style.
|
|
Packit |
e6c7a3 |
[-CodeLayout::ProhibitParensWithBuiltins]
|
|
Packit |
e6c7a3 |
|
|
Packit |
e6c7a3 |
# Stanford's coding style allows postfix unless for flow control. There
|
|
Packit |
e6c7a3 |
# doesn't appear to be any way to allow it only for flow control (the logic
|
|
Packit |
e6c7a3 |
# for "if" and "when" appears to be special-cased), so we have to allow unless
|
|
Packit |
e6c7a3 |
# globally.
|
|
Packit |
e6c7a3 |
[ControlStructures::ProhibitPostfixControls]
|
|
Packit |
e6c7a3 |
allow = unless
|
|
Packit |
e6c7a3 |
|
|
Packit |
e6c7a3 |
# This is handled with a separate test case that uses Test::Spelling.
|
|
Packit |
e6c7a3 |
[-Documentation::PodSpelling]
|
|
Packit |
e6c7a3 |
|
|
Packit |
e6c7a3 |
# Pod::Man and Pod::Text fixed this bug years ago. I know, I maintain them.
|
|
Packit |
e6c7a3 |
[-Documentation::RequirePodLinksIncludeText]
|
|
Packit |
e6c7a3 |
|
|
Packit |
e6c7a3 |
# The POD sections Perl::Critic wants are incompatible with the POD template
|
|
Packit |
e6c7a3 |
# from perlpodstyle, which is what I use for my POD documentation.
|
|
Packit |
e6c7a3 |
[-Documentation::RequirePodSections]
|
|
Packit |
e6c7a3 |
|
|
Packit |
e6c7a3 |
# This problem was fixed in Perl 5.14, which now properly preserves the value
|
|
Packit |
e6c7a3 |
# of $@ even if destructors run at exit from the eval block.
|
|
Packit |
e6c7a3 |
[-ErrorHandling::RequireCheckingReturnValueOfEval]
|
|
Packit |
e6c7a3 |
|
|
Packit |
e6c7a3 |
# The default of 9 is too small and forces weird code contortions.
|
|
Packit |
e6c7a3 |
[InputOutput::RequireBriefOpen]
|
|
Packit |
e6c7a3 |
lines = 25
|
|
Packit |
e6c7a3 |
|
|
Packit |
e6c7a3 |
# This is correct 80% of the time, but it isn't correct for a lot of scripts
|
|
Packit |
e6c7a3 |
# inside packages, where maintaining $VERSION isn't worth the effort.
|
|
Packit |
e6c7a3 |
# Unfortunately, there's no way to override it, so it gets turned off
|
|
Packit |
e6c7a3 |
# globally.
|
|
Packit |
e6c7a3 |
[-Modules::RequireVersionVar]
|
|
Packit |
e6c7a3 |
|
|
Packit |
e6c7a3 |
# This sounds interesting but is actually useless. Any large blocks of
|
|
Packit |
e6c7a3 |
# literal text, which does not add to the complexity of the regex, will set it
|
|
Packit |
e6c7a3 |
# off.
|
|
Packit |
e6c7a3 |
[-RegularExpressions::ProhibitComplexRegexes]
|
|
Packit |
e6c7a3 |
|
|
Packit |
e6c7a3 |
# I generally don't want to require Readonly as a prerequisite for all my Perl
|
|
Packit |
e6c7a3 |
# modules.
|
|
Packit |
e6c7a3 |
[-ValuesAndExpressions::ProhibitConstantPragma]
|
|
Packit |
e6c7a3 |
|
|
Packit |
e6c7a3 |
# A good idea, but there are too many places where this would be more
|
|
Packit |
e6c7a3 |
# confusing than helpful. Pull out numbers if one might change them
|
|
Packit |
e6c7a3 |
# independent of the algorithm, but don't do so for mathematical formulae.
|
|
Packit |
e6c7a3 |
[-ValuesAndExpressions::ProhibitMagicNumbers]
|
|
Packit |
e6c7a3 |
|
|
Packit |
e6c7a3 |
# Increase this to six digits so that I'm not told to add underscores to
|
|
Packit |
e6c7a3 |
# port numbers (which is just silly).
|
|
Packit |
e6c7a3 |
[ValuesAndExpressions::RequireNumberSeparators]
|
|
Packit |
e6c7a3 |
min_value = 100000
|
|
Packit |
e6c7a3 |
|
|
Packit |
e6c7a3 |
# Text::Wrap has a broken interface that requires use of package variables.
|
|
Packit |
e6c7a3 |
[Variables::ProhibitPackageVars]
|
|
Packit |
e6c7a3 |
add_packages = Text::Wrap
|
|
Packit |
e6c7a3 |
|
|
Packit |
e6c7a3 |
# use English was one of the worst ideas in the history of Perl. It makes the
|
|
Packit |
e6c7a3 |
# code slightly more readable for amateurs at the cost of confusing
|
|
Packit |
e6c7a3 |
# experienced Perl programmers and sending people in futile quests for where
|
|
Packit |
e6c7a3 |
# these magical global variables are defined.
|
|
Packit |
e6c7a3 |
[-Variables::ProhibitPunctuationVars]
|