The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.
# Perl::Critic resource file
#
# $Id: 01critic.rc 8216 2009-07-25 22:16:50Z FREQUENCY@cpan.org $
#
# By Jonathan Yu <frequency@cpan.org>, 2009. All rights reversed.
#
# $Id: 01critic.rc 8216 2009-07-25 22:16:50Z FREQUENCY@cpan.org $
#
# This package and its contents are released by the author into the
# Public Domain, to the full extent permissible by law. For additional
# information, please see the included `LICENSE' file.

severity = brutal

###################################################
############### CODE SYNTAX
###################################################

# Exceptions are used (via Carp), so this is unnecessary
[-ErrorHandling::RequireCheckingReturnValueOfEval]

# Checking the return status of each print call is tedious
[InputOutput::RequireCheckedSyscalls]
functions = :builtins
exclude_functions = print

# I don't see anything wrong with postfix controls or unless blocks
[-ControlStructures::ProhibitPostfixControls]
[-ControlStructures::ProhibitUnlessBlocks]

# I think the opposite; parantheses help keep parameters together and
# reduce confusion. Removing them is dangerous in expressions like:
#   open FILE, $filename or die()
[-CodeLayout::ProhibitParensWithBuiltins]

###################################################
############### CODE FORMATTING
###################################################

[CodeLayout::ProhibitHardTabs]
allow_leading_tabs = 0

# I don't like the perltidy style
[-CodeLayout::RequireTidyCode]

# Not sure why /x and /m should be "required"
[-RegularExpressions::RequireExtendedFormatting]
[-RegularExpressions::RequireLineBoundaryMatching]

# I don't think anything's wrong with punctuation variables
[-Variables::ProhibitPunctuationVars]

# Magic numbers are bad, but I'm trusting myself to document them
# appropriately (unless, of course, they are obvious)
[-ValuesAndExpressions::ProhibitMagicNumbers]

# Most detected quotes don't look all that noisy, and I'm trusting myself to
# change to q{} if it is clearer.
[-ValuesAndExpressions::ProhibitNoisyQuotes]

# I often use empty quotes and don't want to litter my namespace with new
# symbols (like $SPACE) for little to no gain.
[-ValuesAndExpressions::ProhibitEmptyQuotes]

###################################################
############### DOCUMENTATION
###################################################

# Ensure that appropriate POD sections exist
[Documentation::RequirePodSections]
lib_sections    = NAME|DESCRIPTION|SYNOPSIS|AUTHOR|LICENSE|SUPPORT
script_sections = NAME|DESCRIPTION|SYNOPSIS|AUTHOR|LICENSE|SUPPORT

# This restriction is silly; some measure of performance gain is not worth
# isolating the documentation from the code it documents.
[-Documentation::RequirePodAtEnd]

# This causes spurious failures due to its poor handling of taint mode.
[-Documentation::PodSpelling]

# Ensure that each file is tagged with an Id
[Miscellanea::RequireRcsKeywords]
keywords = Id