diff --git a/cpanfile b/cpanfile index 6a83b401..79d603b6 100644 --- a/cpanfile +++ b/cpanfile @@ -47,6 +47,7 @@ on test => sub { requires 'Test::Exception'; requires 'Test::More' => '0.88'; requires 'Test::Without::Module' => '0.20'; + requires 'Perl::Critic::Community'; }; on develop => sub { diff --git a/t/perlcriticrc b/t/perlcriticrc index 47aef7fc..ba5171d4 100644 --- a/t/perlcriticrc +++ b/t/perlcriticrc @@ -1,73 +1,2298 @@ +# Globals +# severity = 5 +# force = 0 +# only = 0 +# allow-unsafe = 0 +# profile-strictness = warn +# color = 0 +# pager = +# top = 0 +# verbose = 4 +# include = +# exclude = +# single-policy = +# theme = +# color-severity-highest = bold red +# color-severity-high = magenta +# color-severity-medium = +# color-severity-low = +# color-severity-lowest = +# program-extensions = -severity = 5 -verbose = 3 +# Use `List::MoreUtils::any' instead of `grep' in boolean context. +[BuiltinFunctions::ProhibitBooleanGrep] +# set_themes = certrec core pbp performance +# add_themes = +# severity = 2 +# maximum_violations_per_document = no_limit -#------------------------------------------------------------------------------ -# REF: https://metacpan.org/pod/Perl::Critic::Policy::Documentation::RequirePodSections +# Map blocks should have a single statement. +[BuiltinFunctions::ProhibitComplexMappings] +# set_themes = complexity core maintenance pbp +# add_themes = +# severity = 3 +# maximum_violations_per_document = no_limit + +# The maximum number of statements to allow within a map block. +# Minimum value 1. No maximum. +# max_statements = 1 + + +# Use 4-argument `substr' instead of writing `substr($foo, 2, 6) = $bar'. +[BuiltinFunctions::ProhibitLvalueSubstr] +# set_themes = core maintenance pbp +# add_themes = +# severity = 3 +# maximum_violations_per_document = no_limit + + +# Forbid $b before $a in sort blocks. +[BuiltinFunctions::ProhibitReverseSortBlock] +# set_themes = core cosmetic pbp +# add_themes = +# severity = 1 +# maximum_violations_per_document = no_limit + + +# Prohibit `\shift' in code +[BuiltinFunctions::ProhibitShiftRef] +# set_themes = bugs core tests +# add_themes = +# severity = 3 +# maximum_violations_per_document = no_limit + + +# Use Time::HiRes instead of something like `select(undef, undef, undef, .05)'. +[BuiltinFunctions::ProhibitSleepViaSelect] +# set_themes = bugs core pbp +# add_themes = +# severity = 5 +# maximum_violations_per_document = no_limit + + +# Write `eval { my $foo; bar($foo) }' instead of `eval "my $foo; bar($foo);"'. +[BuiltinFunctions::ProhibitStringyEval] +# set_themes = bugs certrule core pbp +# add_themes = +# severity = 5 +# maximum_violations_per_document = no_limit + +# Allow eval of "use" and "require" strings. +# allow_includes = 0 + + +# Write `split /-/, $string' instead of `split '-', $string'. +[BuiltinFunctions::ProhibitStringySplit] +# set_themes = certrule core cosmetic pbp +# add_themes = +# severity = 2 +# maximum_violations_per_document = no_limit + + +# Write `eval { $foo->can($name) }' instead of `UNIVERSAL::can($foo, $name)'. +[BuiltinFunctions::ProhibitUniversalCan] +# set_themes = certrule core maintenance +# add_themes = +# severity = 3 +# maximum_violations_per_document = no_limit + + +# Write `eval { $foo->isa($pkg) }' instead of `UNIVERSAL::isa($foo, $pkg)'. +[BuiltinFunctions::ProhibitUniversalIsa] +# set_themes = certrule core maintenance +# add_themes = +# severity = 3 +# maximum_violations_per_document = no_limit + + +# Don't pass $_ to built-in functions that assume it, or to most filetest operators. +[BuiltinFunctions::ProhibitUselessTopic] +# set_themes = core +# add_themes = +# severity = 2 +# maximum_violations_per_document = no_limit + + +# Don't use `grep' in void contexts. +[BuiltinFunctions::ProhibitVoidGrep] +# set_themes = core maintenance +# add_themes = +# severity = 3 +# maximum_violations_per_document = no_limit + + +# Don't use `map' in void contexts. +[BuiltinFunctions::ProhibitVoidMap] +# set_themes = core maintenance +# add_themes = +# severity = 3 +# maximum_violations_per_document = no_limit + + +# Write `grep { /$pattern/ } @list' instead of `grep /$pattern/, @list'. +[BuiltinFunctions::RequireBlockGrep] +# set_themes = bugs core pbp +# add_themes = +# severity = 4 +# maximum_violations_per_document = no_limit + + +# Write `map { /$pattern/ } @list' instead of `map /$pattern/, @list'. +[BuiltinFunctions::RequireBlockMap] +# set_themes = bugs core pbp +# add_themes = +# severity = 4 +# maximum_violations_per_document = no_limit + + +# Use `glob q{*}' instead of <*>. +[BuiltinFunctions::RequireGlobFunction] +# set_themes = bugs core pbp +# add_themes = +# severity = 5 +# maximum_violations_per_document = no_limit + + +# Sort blocks should have a single statement. +[BuiltinFunctions::RequireSimpleSortBlock] +# set_themes = complexity core maintenance pbp +# add_themes = +# severity = 3 +# maximum_violations_per_document = no_limit + + +# AUTOLOAD methods should be avoided. +[ClassHierarchies::ProhibitAutoloading] +# set_themes = core maintenance pbp +# add_themes = +# severity = 3 +# maximum_violations_per_document = no_limit + + +# Employ `use base' instead of `@ISA'. +[ClassHierarchies::ProhibitExplicitISA] +# set_themes = certrec core maintenance pbp +# add_themes = +# severity = 3 +# maximum_violations_per_document = no_limit + + +# Write `bless {}, $class;' instead of just `bless {};'. +[ClassHierarchies::ProhibitOneArgBless] +# set_themes = bugs core pbp +# add_themes = +# severity = 5 +# maximum_violations_per_document = no_limit + + +# keep a fat comma on the same line as its quoted word +[CodeLayout::ProhibitFatCommaNewline] +# set_themes = bugs pulp +# add_themes = +# severity = 3 +# maximum_violations_per_document = no_limit + + +# Use spaces instead of tabs. +[CodeLayout::ProhibitHardTabs] +# set_themes = core cosmetic pbp +# add_themes = +# severity = 3 +# maximum_violations_per_document = no_limit + +# Allow hard tabs before first non-whitespace character. +# allow_leading_tabs = 1 + + +# don't put if after if on same line +[CodeLayout::ProhibitIfIfSameLine] +# set_themes = bugs pulp +# add_themes = +# severity = 3 +# maximum_violations_per_document = no_limit + + +# Write `open $handle, $path' instead of `open($handle, $path)'. +[CodeLayout::ProhibitParensWithBuiltins] +# set_themes = core cosmetic pbp +# add_themes = +# severity = 1 +# maximum_violations_per_document = no_limit + + +# Write `qw(foo bar baz)' instead of `('foo', 'bar', 'baz')'. +[CodeLayout::ProhibitQuotedWordLists] +# set_themes = core cosmetic +# add_themes = +# severity = 2 +# maximum_violations_per_document = no_limit + +# The minimum number of words in a list that will be complained about. +# Minimum value 1. No maximum. +# min_elements = 2 + +# Complain even if there are non-word characters in the values. +# strict = 0 + + +# Don't use whitespace at the end of lines. +[CodeLayout::ProhibitTrailingWhitespace] +# set_themes = core maintenance +# add_themes = +# severity = 1 +# maximum_violations_per_document = no_limit + + +# Use the same newline through the source. +[CodeLayout::RequireConsistentNewlines] +# set_themes = bugs core +# add_themes = +# severity = 4 +# maximum_violations_per_document = no_limit + + +# require a semicolon at the end of code blocks +[CodeLayout::RequireFinalSemicolon] +# set_themes = cosmetic pulp +# add_themes = +# severity = 2 +# maximum_violations_per_document = no_limit + +# Whether to allow no semicolon at the end of blocks with the } closing brace on the same line as the last statement. +# except_same_line = 1 + +# Whether to allow no semicolon at the end of do{} expression blocks. +# except_expression_blocks = 1 + + +# Must run code through perltidy. +[CodeLayout::RequireTidyCode] +# set_themes = core cosmetic pbp +# add_themes = +# severity = 1 +# maximum_violations_per_document = no_limit + +# The Perl::Tidy configuration file to use, if any. +# perltidyrc = + + +# comma at end of list at newline +[CodeLayout::RequireTrailingCommaAtNewline] +# set_themes = cosmetic pulp +# add_themes = +# severity = 2 +# maximum_violations_per_document = no_limit + +# Don't demand a trailing comma in function call argument lists. +# except_function_calls = 0 + + +# Put a comma at the end of every multi-line list declaration, including the last one. +[CodeLayout::RequireTrailingCommas] +# set_themes = core cosmetic pbp +# add_themes = +# severity = 1 +# maximum_violations_per_document = no_limit + + +# Don't use & to call subroutines +[Community::AmpersandSubCalls] +# set_themes = community +# add_themes = +# severity = 4 +# maximum_violations_per_document = no_limit + + +# Don't assign an anonymous arrayref to an array +[Community::ArrayAssignAref] +# set_themes = community +# add_themes = +# severity = 3 +# maximum_violations_per_document = no_limit + + +# Don't use bareword filehandles other than built-ins +[Community::BarewordFilehandles] +# set_themes = community +# add_themes = +# severity = 4 +# maximum_violations_per_document = no_limit + + +# Don't declare variables conditionally +[Community::ConditionalDeclarations] +# set_themes = community +# add_themes = +# severity = 4 +# maximum_violations_per_document = no_limit + + +# Don't end a subroutine with a conditional block +[Community::ConditionalImplicitReturn] +# set_themes = community +# add_themes = +# severity = 3 +# maximum_violations_per_document = no_limit + + +# Avoid features that have been deprecated or removed from Perl +[Community::DeprecatedFeatures] +# set_themes = community +# add_themes = +# severity = 4 +# maximum_violations_per_document = no_limit + + +# Various modules discouraged from use +[Community::DiscouragedModules] +# set_themes = community +# add_themes = +# severity = 4 +# maximum_violations_per_document = no_limit + +# Modules that you want to allow, despite being discouraged. +# allowed_modules = + + +# Don't use $a or $b as variable names outside sort +[Community::DollarAB] +# set_themes = community +# add_themes = +# severity = 4 +# maximum_violations_per_document = no_limit + +# Non-standard functions in which to allow $a and $b. +# extra_pair_functions = + + +# Don't use each to iterate through a hash +[Community::Each] +# set_themes = community +# add_themes = +# severity = 2 +# maximum_violations_per_document = no_limit + + +# Don't use return with no arguments +[Community::EmptyReturn] +# set_themes = community +# add_themes = +# severity = 1 +# maximum_violations_per_document = no_limit + + +# Don't call methods indirectly +[Community::IndirectObjectNotation] +# set_themes = community +# add_themes = +# severity = 5 +# maximum_violations_per_document = no_limit + +# Indirect method syntax is forbidden for these methods. +# Values that are always included: new. +# forbid = + + +# Don't use undeclared foreach loop iterators +[Community::LexicalForeachIterator] +# set_themes = community +# add_themes = +# severity = 4 +# maximum_violations_per_document = no_limit + + +# Don't loop over hashes +[Community::LoopOnHash] +# set_themes = community +# add_themes = +# severity = 4 +# maximum_violations_per_document = no_limit + + +# Don't use mod_perl to write web applications +[Community::ModPerl] +# set_themes = community +# add_themes = +# severity = 4 +# maximum_violations_per_document = no_limit + + +# Don't use multidimensional array emulation +[Community::MultidimensionalArrayEmulation] +# set_themes = community +# add_themes = +# severity = 2 +# maximum_violations_per_document = no_limit + + +# Always use the three-argument form of open +[Community::OpenArgs] +# set_themes = community +# add_themes = +# severity = 3 +# maximum_violations_per_document = no_limit + + +# Don't use overload without specifying a bool overload and enabling fallback +[Community::OverloadOptions] +# set_themes = community +# add_themes = +# severity = 4 +# maximum_violations_per_document = no_limit + + +# Don't use POSIX without specifying an import list +[Community::POSIXImports] +# set_themes = community +# add_themes = +# severity = 2 +# maximum_violations_per_document = no_limit + + +# Module files should declare a package matching the filename +[Community::PackageMatchesFilename] +# set_themes = community +# add_themes = +# severity = 4 +# maximum_violations_per_document = no_limit +# Cannot programmatically discover what parameters this policy takes. + + +# Various modules with preferred alternatives +[Community::PreferredAlternatives] +# set_themes = community +# add_themes = +# severity = 2 +# maximum_violations_per_document = no_limit + +# Modules that you want to allow, despite there being a preferred alternative. +# allowed_modules = + + +# Don't use function prototypes +[Community::Prototypes] +# set_themes = community +# add_themes = +# severity = 3 +# maximum_violations_per_document = no_limit + +# Non-standard modules to recognize as enabling signatures. +# signature_enablers = + + +# Always use strict and warnings, or a module that imports these +[Community::StrictWarnings] +# set_themes = community +# add_themes = +# severity = 4 +# maximum_violations_per_document = no_limit + +# Non-standard modules to recognize as importing strict and warnings. +# extra_importers = + + +# Interpreter-based threads are officially discouraged +[Community::Threads] +# set_themes = community +# add_themes = +# severity = 3 +# maximum_violations_per_document = no_limit + + +# Don't write context-sensitive functions using wantarray +[Community::Wantarray] +# set_themes = community +# add_themes = +# severity = 2 +# maximum_violations_per_document = no_limit + + +# Scripts should not use the -w switch on the shebang line +[Community::WarningsSwitch] +# set_themes = community +# add_themes = +# severity = 2 +# maximum_violations_per_document = no_limit + + +# Don't use while with implicit assignment to $_ +[Community::WhileDiamondDefaultAssignment] +# set_themes = community +# add_themes = +# severity = 4 +# maximum_violations_per_document = no_limit + + +# new enough "constant" module for leading underscores +[Compatibility::ConstantLeadingUnderscore] +# set_themes = compatibility pulp +# add_themes = +# severity = 3 +# maximum_violations_per_document = no_limit + + +# new enough "constant" module for multiple constants +[Compatibility::ConstantPragmaHash] +# set_themes = compatibility pulp +# add_themes = +# severity = 3 +# maximum_violations_per_document = no_limit + + +# new enough Gtk2 version for its constants +[Compatibility::Gtk2Constants] +# set_themes = bugs pulp +# add_themes = +# severity = 3 +# maximum_violations_per_document = no_limit + + +# explicit Perl version for features used +[Compatibility::PerlMinimumVersionAndWhy] +# set_themes = compatibility pulp +# add_themes = +# severity = 2 +# maximum_violations_per_document = no_limit + +# Check only things above this version of Perl. +# above_version = + +# Version checks to skip (space separated list). +# skip_checks = + + +# check Perl version declared against POD features used +[Compatibility::PodMinimumVersion] +# set_themes = compatibility pulp +# add_themes = +# severity = 2 +# maximum_violations_per_document = no_limit + +# Check only things above this version of Perl. +# above_version = + + +# don't use explicit /dev/null +[Compatibility::ProhibitUnixDevNull] +# set_themes = bugs pulp +# add_themes = +# severity = 2 +# maximum_violations_per_document = no_limit + + +# Write `for(0..20)' instead of `for($i=0; $i<=20; $i++)'. +[ControlStructures::ProhibitCStyleForLoops] +# set_themes = core maintenance pbp +# add_themes = +# severity = 2 +# maximum_violations_per_document = no_limit + + +# Don't write long "if-elsif-elsif-elsif-elsif...else" chains. +[ControlStructures::ProhibitCascadingIfElse] +# set_themes = complexity core maintenance pbp +# add_themes = +# severity = 3 +# maximum_violations_per_document = no_limit + +# The maximum number of alternatives that will be allowed. +# Minimum value 1. No maximum. +# max_elsif = 2 + + +# Don't write deeply nested loops and conditionals. +[ControlStructures::ProhibitDeepNests] +# set_themes = complexity core maintenance +# add_themes = +# severity = 3 +# maximum_violations_per_document = no_limit + +# The maximum number of nested constructs to allow. +# Minimum value 1. No maximum. +# max_nests = 5 + + +# Don't use labels that are the same as the special block names. +[ControlStructures::ProhibitLabelsWithSpecialBlockNames] +# set_themes = bugs core +# add_themes = +# severity = 4 +# maximum_violations_per_document = no_limit + + +# Don't modify `$_' in list functions. +[ControlStructures::ProhibitMutatingListFunctions] +# set_themes = bugs certrule core pbp +# add_themes = +# severity = 5 +# maximum_violations_per_document = no_limit + +# The base set of functions to check. +# list_funcs = map grep List::Util::first List::MoreUtils::any List::MoreUtils::all List::MoreUtils::none List::MoreUtils::notall List::MoreUtils::true List::MoreUtils::false List::MoreUtils::firstidx List::MoreUtils::first_index List::MoreUtils::lastidx List::MoreUtils::last_index List::MoreUtils::insert_after List::MoreUtils::insert_after_string + +# The set of functions to check, in addition to those given in list_funcs. +# add_list_funcs = + + +# Don't use operators like `not', `!~', and `le' within `until' and `unless'. +[ControlStructures::ProhibitNegativeExpressionsInUnlessAndUntilConditions] +# set_themes = core maintenance pbp +# add_themes = +# severity = 3 +# maximum_violations_per_document = no_limit + + +# Write `if($condition){ do_something() }' instead of `do_something() if $condition'. +[ControlStructures::ProhibitPostfixControls] +# set_themes = core cosmetic pbp +# add_themes = +# severity = 2 +# maximum_violations_per_document = no_limit + +# The permitted postfix controls. +# Valid values: for, foreach, if, unless, until, when, while. +# allow = + +# The exempt flow control functions. +# flowcontrol = carp cluck confess croak die exit goto warn + + +# Write `if(! $condition)' instead of `unless($condition)'. +[ControlStructures::ProhibitUnlessBlocks] +# set_themes = core cosmetic pbp +# add_themes = +# severity = 2 +# maximum_violations_per_document = no_limit + + +# Don't write code after an unconditional `die, exit, or next'. +[ControlStructures::ProhibitUnreachableCode] +# set_themes = bugs certrec core +# add_themes = +# severity = 4 +# maximum_violations_per_document = no_limit + + +# Write `while(! $condition)' instead of `until($condition)'. +[ControlStructures::ProhibitUntilBlocks] +# set_themes = core cosmetic pbp +# add_themes = +# severity = 2 +# maximum_violations_per_document = no_limit + + +# Never use `...' in production code. +[ControlStructures::ProhibitYadaOperator] +# set_themes = core maintenance pbp +# add_themes = +# severity = 4 +# maximum_violations_per_document = no_limit + + +# consecutive L<> links +[Documentation::ProhibitAdjacentLinks] +# set_themes = cosmetic pulp +# add_themes = +# severity = 1 +# maximum_violations_per_document = no_limit + + +# don't use C<> markup in a NAME section +[Documentation::ProhibitBadAproposMarkup] +# set_themes = cosmetic pulp +# add_themes = +# severity = 2 +# maximum_violations_per_document = no_limit + + +# don't duplicate =head names +[Documentation::ProhibitDuplicateHeadings] +# set_themes = bugs pulp +# add_themes = +# severity = 3 +# maximum_violations_per_document = no_limit + +# The scope for headings names, meaning to what extent they must not be duplicates. Choices nested, all. +# uniqueness = default + + +# don't duplicate L<> links in SEE ALSO +[Documentation::ProhibitDuplicateSeeAlso] +# set_themes = cosmetic pulp +# add_themes = +# severity = 2 +# maximum_violations_per_document = no_limit + + +# don't L<> link to own POD +[Documentation::ProhibitLinkToSelf] +# set_themes = cosmetic pulp +# add_themes = +# severity = 2 +# maximum_violations_per_document = no_limit + + +# avoid comma at end of section +[Documentation::ProhibitParagraphEndComma] +# set_themes = cosmetic pulp +# add_themes = +# severity = 1 +# maximum_violations_per_document = no_limit + + +# don't end a paragraph with two dots +[Documentation::ProhibitParagraphTwoDots] +# set_themes = cosmetic pulp +# add_themes = +# severity = 1 +# maximum_violations_per_document = no_limit + + +# don't leave an open bracket or paren +[Documentation::ProhibitUnbalancedParens] +# set_themes = cosmetic pulp +# add_themes = +# severity = 2 +# maximum_violations_per_document = no_limit + + +# unexpanded C<> etc markup in POD verbatim paras +[Documentation::ProhibitVerbatimMarkup] +# set_themes = cosmetic pulp +# add_themes = +# severity = 2 +# maximum_violations_per_document = no_limit + + +# require __END__ before POD at end of file +[Documentation::RequireEndBeforeLastPod] +# set_themes = cosmetic pulp +# add_themes = +# severity = 2 +# maximum_violations_per_document = 1 + + +# markup /foo filenames +[Documentation::RequireFilenameMarkup] +# set_themes = cosmetic pulp +# add_themes = +# severity = 2 +# maximum_violations_per_document = no_limit + + +# end POD with =cut directive +[Documentation::RequireFinalCut] +# set_themes = cosmetic pulp +# add_themes = +# severity = 1 +# maximum_violations_per_document = no_limit + + +# use L<> markup on URLs in POD +[Documentation::RequireLinkedURLs] +# set_themes = cosmetic pulp +# add_themes = +# severity = 2 +# maximum_violations_per_document = no_limit + + +# The `=head1 NAME' section should match the package. +[Documentation::RequirePackageMatchesPodName] +# set_themes = core cosmetic +# add_themes = +# severity = 1 +# maximum_violations_per_document = no_limit + + +# All POD should be after `__END__'. +[Documentation::RequirePodAtEnd] +# set_themes = core cosmetic pbp +# add_themes = +# severity = 1 +# maximum_violations_per_document = no_limit + + +# Organize your POD into the customary sections. [Documentation::RequirePodSections] -lib_sections = NAME|DESCRIPTION|SYNOPSIS|AUTHORS|COPYRIGHT -script_sections = NAME|DESCRIPTION|SYNOPSIS|AUTHORS|COPYRIGHT +# set_themes = core maintenance pbp +# add_themes = +# severity = 2 +# maximum_violations_per_document = no_limit + +# The sections to require for modules (separated by qr/\s* [|] \s*/xms). +# lib_sections = + +# The sections to require for programs (separated by qr/\s* [|] \s*/xms). +# script_sections = + +# The origin of sections to use. +# Valid values: book, book_first_edition, module_starter_pbp, module_starter_pbp_0_0_3. +# source = book_first_edition + +# The spelling of sections to use. +# Valid values: en_AU, en_US. +# language = + + +# Use functions from Carp instead of `warn' or `die'. +[ErrorHandling::RequireCarping] +# set_themes = certrule core maintenance pbp +# add_themes = +# severity = 3 +# maximum_violations_per_document = no_limit + +# Don't complain about die or warn if the message ends in a newline. +# allow_messages_ending_with_newlines = 1 + +# Don't complain about die or warn in main::, unless in a subroutine. +# allow_in_main_unless_in_subroutine = 0 + + +# You can't depend upon the value of `$@'/`$EVAL_ERROR' to tell whether an `eval' failed. +[ErrorHandling::RequireCheckingReturnValueOfEval] +# set_themes = bugs core +# add_themes = +# severity = 3 +# maximum_violations_per_document = no_limit + + +# Don't use & to call subroutines +[Freenode::AmpersandSubCalls] +# set_themes = freenode +# add_themes = +# severity = 4 +# maximum_violations_per_document = no_limit + + +# Don't assign an anonymous arrayref to an array +[Freenode::ArrayAssignAref] +# set_themes = freenode +# add_themes = +# severity = 3 +# maximum_violations_per_document = no_limit + + +# Don't use bareword filehandles other than built-ins +[Freenode::BarewordFilehandles] +# set_themes = freenode +# add_themes = +# severity = 4 +# maximum_violations_per_document = no_limit + + +# Don't declare variables conditionally +[Freenode::ConditionalDeclarations] +# set_themes = freenode +# add_themes = +# severity = 4 +# maximum_violations_per_document = no_limit + + +# Don't end a subroutine with a conditional block +[Freenode::ConditionalImplicitReturn] +# set_themes = freenode +# add_themes = +# severity = 3 +# maximum_violations_per_document = no_limit + + +# Avoid features that have been deprecated or removed from Perl +[Freenode::DeprecatedFeatures] +# set_themes = freenode +# add_themes = +# severity = 4 +# maximum_violations_per_document = no_limit + + +# Various modules discouraged from use +[Freenode::DiscouragedModules] +# set_themes = freenode +# add_themes = +# severity = 4 +# maximum_violations_per_document = no_limit + +# Modules that you want to allow, despite being discouraged. +# allowed_modules = + + +# Don't use $a or $b as variable names outside sort +[Freenode::DollarAB] +# set_themes = freenode +# add_themes = +# severity = 4 +# maximum_violations_per_document = no_limit + +# Non-standard functions in which to allow $a and $b. +# extra_pair_functions = + + +# Don't use each to iterate through a hash +[Freenode::Each] +# set_themes = freenode +# add_themes = +# severity = 2 +# maximum_violations_per_document = no_limit + + +# Don't use return with no arguments +[Freenode::EmptyReturn] +# set_themes = freenode +# add_themes = +# severity = 1 +# maximum_violations_per_document = no_limit + + +# Don't call methods indirectly +[Freenode::IndirectObjectNotation] +# set_themes = freenode +# add_themes = +# severity = 5 +# maximum_violations_per_document = no_limit + +# Indirect method syntax is forbidden for these methods. +# Values that are always included: new. +# forbid = + + +# Don't use undeclared foreach loop iterators +[Freenode::LexicalForeachIterator] +# set_themes = freenode +# add_themes = +# severity = 4 +# maximum_violations_per_document = no_limit + + +# Don't loop over hashes +[Freenode::LoopOnHash] +# set_themes = freenode +# add_themes = +# severity = 4 +# maximum_violations_per_document = no_limit + + +# Don't use mod_perl to write web applications +[Freenode::ModPerl] +# set_themes = freenode +# add_themes = +# severity = 4 +# maximum_violations_per_document = no_limit + + +# Don't use multidimensional array emulation +[Freenode::MultidimensionalArrayEmulation] +# set_themes = freenode +# add_themes = +# severity = 2 +# maximum_violations_per_document = no_limit + + +# Always use the three-argument form of open +[Freenode::OpenArgs] +# set_themes = freenode +# add_themes = +# severity = 3 +# maximum_violations_per_document = no_limit + + +# Don't use overload without specifying a bool overload and enabling fallback +[Freenode::OverloadOptions] +# set_themes = freenode +# add_themes = +# severity = 4 +# maximum_violations_per_document = no_limit + + +# Don't use POSIX without specifying an import list +[Freenode::POSIXImports] +# set_themes = freenode +# add_themes = +# severity = 2 +# maximum_violations_per_document = no_limit + + +# Module files should declare a package matching the filename +[Freenode::PackageMatchesFilename] +# set_themes = freenode +# add_themes = +# severity = 4 +# maximum_violations_per_document = no_limit +# Cannot programmatically discover what parameters this policy takes. + + +# Various modules with preferred alternatives +[Freenode::PreferredAlternatives] +# set_themes = freenode +# add_themes = +# severity = 2 +# maximum_violations_per_document = no_limit + +# Modules that you want to allow, despite there being a preferred alternative. +# allowed_modules = + + +# Don't use function prototypes +[Freenode::Prototypes] +# set_themes = freenode +# add_themes = +# severity = 3 +# maximum_violations_per_document = no_limit + +# Non-standard modules to recognize as enabling signatures. +# signature_enablers = + + +# Always use strict and warnings, or a module that imports these +[Freenode::StrictWarnings] +# set_themes = freenode +# add_themes = +# severity = 4 +# maximum_violations_per_document = no_limit + +# Non-standard modules to recognize as importing strict and warnings. +# extra_importers = + + +# Interpreter-based threads are officially discouraged +[Freenode::Threads] +# set_themes = freenode +# add_themes = +# severity = 3 +# maximum_violations_per_document = no_limit + + +# Don't write context-sensitive functions using wantarray +[Freenode::Wantarray] +# set_themes = freenode +# add_themes = +# severity = 2 +# maximum_violations_per_document = no_limit + + +# Scripts should not use the -w switch on the shebang line +[Freenode::WarningsSwitch] +# set_themes = freenode +# add_themes = +# severity = 2 +# maximum_violations_per_document = no_limit + + +# Don't use while with implicit assignment to $_ +[Freenode::WhileDiamondDefaultAssignment] +# set_themes = freenode +# add_themes = +# severity = 4 +# maximum_violations_per_document = no_limit + + +# Discourage stuff like `@files = `ls $directory`'. +[InputOutput::ProhibitBacktickOperators] +# set_themes = core maintenance +# add_themes = +# severity = 3 +# maximum_violations_per_document = no_limit + +# Allow backticks everywhere except in void contexts. +# only_in_void_context = + + +# Write `open my $fh, q{<}, $filename;' instead of `open FH, q{<}, $filename;'. +[InputOutput::ProhibitBarewordFileHandles] +# set_themes = bugs certrec core pbp +# add_themes = +# severity = 5 +# maximum_violations_per_document = no_limit + + +# Use "<>" or "" or a prompting module instead of "". +[InputOutput::ProhibitExplicitStdin] +# set_themes = core maintenance pbp +# add_themes = +# severity = 4 +# maximum_violations_per_document = no_limit + + +# Use prompt() instead of -t. +[InputOutput::ProhibitInteractiveTest] +# set_themes = bugs certrule core pbp +# add_themes = +# severity = 5 +# maximum_violations_per_document = no_limit + + +# Use `local $/ = undef' or Path::Tiny instead of joined readline. +[InputOutput::ProhibitJoinedReadline] +# set_themes = core pbp performance +# add_themes = +# severity = 3 +# maximum_violations_per_document = no_limit + + +# Never write `select($fh)'. +[InputOutput::ProhibitOneArgSelect] +# set_themes = bugs certrule core pbp +# add_themes = +# severity = 4 +# maximum_violations_per_document = no_limit + + +# Write `while( $line = <> ){...}' instead of `for(<>){...}'. +[InputOutput::ProhibitReadlineInForLoop] +# set_themes = bugs core pbp +# add_themes = +# severity = 4 +# maximum_violations_per_document = no_limit + + +# Write `open $fh, q{<}, $filename;' instead of `open $fh, "<$filename";'. +[InputOutput::ProhibitTwoArgOpen] +# set_themes = bugs certrule core pbp security +# add_themes = +# severity = 5 +# maximum_violations_per_document = no_limit + + +# Write `print {$FH} $foo, $bar;' instead of `print $FH $foo, $bar;'. +[InputOutput::RequireBracedFileHandleWithPrint] +# set_themes = core cosmetic pbp +# add_themes = +# severity = 1 +# maximum_violations_per_document = no_limit + + +# Close filehandles as soon as possible after opening them. +[InputOutput::RequireBriefOpen] +# set_themes = core maintenance pbp +# add_themes = +# severity = 4 +# maximum_violations_per_document = no_limit + +# The maximum number of lines between an open() and a close(). +# Minimum value 1. No maximum. +# lines = 9 + + +# Write `my $error = close $fh;' instead of `close $fh;'. +[InputOutput::RequireCheckedClose] +# set_themes = certrule core maintenance +# add_themes = +# severity = 2 +# maximum_violations_per_document = no_limit + +# Modules which export autodie. +# autodie_modules = autodie + + +# Write `my $error = open $fh, $mode, $filename;' instead of `open $fh, $mode, $filename;'. +[InputOutput::RequireCheckedOpen] +# set_themes = certrule core maintenance +# add_themes = +# severity = 3 +# maximum_violations_per_document = no_limit + +# Modules which export autodie. +# autodie_modules = autodie + + +# Return value of flagged function ignored. +[InputOutput::RequireCheckedSyscalls] +# set_themes = certrule core maintenance +# add_themes = +# severity = 1 +# maximum_violations_per_document = no_limit + +# The set of functions to require checking the return value of. +# functions = open close print say + +# The set of functions to not require checking the return value of. +# exclude_functions = + +# Modules which export autodie. +# autodie_modules = autodie + + +# Write `open $fh, q{<:encoding(UTF-8)}, $filename;' instead of `open $fh, q{<:utf8}, $filename;'. +[InputOutput::RequireEncodingWithUTF8Layer] +# set_themes = bugs core security +# add_themes = +# severity = 5 +# maximum_violations_per_document = no_limit + + +# Do not use `format'. +[Miscellanea::ProhibitFormats] +# set_themes = certrule core maintenance pbp +# add_themes = +# severity = 3 +# maximum_violations_per_document = no_limit + + +# Do not use `tie'. +[Miscellanea::ProhibitTies] +# set_themes = core maintenance pbp +# add_themes = +# severity = 2 +# maximum_violations_per_document = no_limit + + +# Forbid a bare `## no critic' +[Miscellanea::ProhibitUnrestrictedNoCritic] +# set_themes = core maintenance +# add_themes = +# severity = 3 +# maximum_violations_per_document = no_limit + + +# Remove ineffective "## no critic" annotations. +[Miscellanea::ProhibitUselessNoCritic] +# set_themes = core maintenance +# add_themes = +# severity = 2 +# maximum_violations_per_document = no_limit + + +# check placeholder names in Locale::TextDomain calls +[Miscellanea::TextDomainPlaceholders] +# set_themes = bugs pulp +# add_themes = +# severity = 3 +# maximum_violations_per_document = no_limit + + +# check for Locale::TextDomain imported but unused +[Miscellanea::TextDomainUnused] +# set_themes = cosmetic pulp +# add_themes = +# severity = 2 +# maximum_violations_per_document = no_limit + -# REF: https://metacpan.org/pod/Perl::Critic::Policy::TestingAndDebugging::RequireUseWarnings -[TestingAndDebugging::RequireUseWarnings] +# Export symbols via `@EXPORT_OK' or `%EXPORT_TAGS' instead of `@EXPORT'. +[Modules::ProhibitAutomaticExportation] +# set_themes = bugs core +# add_themes = +# severity = 4 +# maximum_violations_per_document = no_limit -# REF: https://metacpan.org/pod/Perl::Critic::Policy::ValuesAndExpressions::ProhibitMagicNumbers -[ValuesAndExpressions::ProhibitMagicNumbers] -allowed_values = 0 1 2 3 4 5 6 -# Might be to late to address, so it is disabled at various places in the code, could perhaps be -# revisited with a major release, since it would break backwards compatibility, the recommeded -# solution is bare return -# REF: https://metacpan.org/pod/Perl::Critic::Policy::Subroutines::ProhibitExplicitReturnUndef +# Avoid putting conditional logic around compile-time includes. +[Modules::ProhibitConditionalUseStatements] +# set_themes = bugs core +# add_themes = +# severity = 3 +# maximum_violations_per_document = no_limit + + +# Ban modules that aren't blessed by your shop. +[Modules::ProhibitEvilModules] +# set_themes = bugs certrule core +# add_themes = +# severity = 5 +# maximum_violations_per_document = no_limit + +# The names of or patterns for modules to forbid. +# modules = Class::ISA {Found use of Class::ISA. This module is deprecated by the Perl 5 Porters.} Pod::Plainer {Found use of Pod::Plainer. This module is deprecated by the Perl 5 Porters.} Shell {Found use of Shell. This module is deprecated by the Perl 5 Porters.} Switch {Found use of Switch. This module is deprecated by the Perl 5 Porters.} + +# A file containing names of or patterns for modules to forbid. +# modules_file = + + +# Minimize complexity in code that is outside of subroutines. +[Modules::ProhibitExcessMainComplexity] +# set_themes = complexity core maintenance +# add_themes = +# severity = 3 +# maximum_violations_per_document = no_limit + +# The maximum complexity score allowed. +# Minimum value 1. No maximum. +# max_mccabe = 20 + + +# don't put a #! line at the start of a module file +[Modules::ProhibitModuleShebang] +# set_themes = cosmetic pulp +# add_themes = +# severity = 2 +# maximum_violations_per_document = 1 + +# Whether to allow #!/bin/false. +# allow_bin_false = 1 + + +# Put packages (especially subclasses) in separate files. +[Modules::ProhibitMultiplePackages] +# set_themes = bugs core +# add_themes = +# severity = 4 +# maximum_violations_per_document = no_limit + + +# don't import the whole of POSIX into a module +[Modules::ProhibitPOSIXimport] +# set_themes = efficiency pulp +# add_themes = +# severity = 2 +# maximum_violations_per_document = no_limit + + +# avoid quoted version number string in a "use" statement +[Modules::ProhibitUseQuotedVersion] +# set_themes = bugs pulp +# add_themes = +# severity = 3 +# maximum_violations_per_document = no_limit + + +# Write `require Module' instead of `require 'Module.pm''. +[Modules::RequireBarewordIncludes] +# set_themes = core portability +# add_themes = +# severity = 5 +# maximum_violations_per_document = no_limit + + +# End each module with an explicitly `1;' instead of some funky expression. +[Modules::RequireEndWithOne] +# set_themes = bugs certrule core pbp +# add_themes = +# severity = 4 +# maximum_violations_per_document = no_limit + + +# Always make the `package' explicit. +[Modules::RequireExplicitPackage] +# set_themes = bugs core +# add_themes = +# severity = 4 +# maximum_violations_per_document = 1 + +# Don't require programs to contain a package statement. +# exempt_scripts = 1 + +# Allow the specified modules to be imported outside a package. +# allow_import_of = + + +# Package declaration must match filename. +[Modules::RequireFilenameMatchesPackage] +# set_themes = bugs core +# add_themes = +# severity = 5 +# maximum_violations_per_document = no_limit + + +# `use English' must be passed a `-no_match_vars' argument. +[Modules::RequireNoMatchVarsWithUseEnglish] +# set_themes = core performance +# add_themes = +# severity = 2 +# maximum_violations_per_document = no_limit + + +# Give every module a `$VERSION' number. +[Modules::RequireVersionVar] +# set_themes = core pbp readability +# add_themes = +# severity = 2 +# maximum_violations_per_document = no_limit + + +# Distinguish different program components by case. +[NamingConventions::Capitalization] +# set_themes = core cosmetic pbp +# add_themes = +# severity = 1 +# maximum_violations_per_document = no_limit + +# How package name components should be capitalized. Valid values are :single_case, :all_lower, :all_upper:, :starts_with_lower, :starts_with_upper, :no_restriction, or a regex. +# packages = :starts_with_upper + +# Package names that are exempt from capitalization rules. The values here are regexes that will be surrounded by \A and \z. +# package_exemptions = main + +# How subroutine names should be capitalized. Valid values are :single_case, :all_lower, :all_upper, :starts_with_lower, :starts_with_upper, :no_restriction, or a regex. +# subroutines = :single_case + +# Subroutine names that are exempt from capitalization rules. The values here are regexes that will be surrounded by \A and \z. +# subroutine_exemptions = AUTOLOAD BUILD BUILDARGS CLEAR CLOSE DELETE DEMOLISH DESTROY EXISTS EXTEND FETCH FETCHSIZE FIRSTKEY GETC NEXTKEY POP PRINT PRINTF PUSH READ READLINE SCALAR SHIFT SPLICE STORE STORESIZE TIEARRAY TIEHANDLE TIEHASH TIESCALAR UNSHIFT UNTIE WRITE + +# How local lexical variables names should be capitalized. Valid values are :single_case, :all_lower, :all_upper, :starts_with_lower, :starts_with_upper, :no_restriction, or a regex. +# local_lexical_variables = :single_case + +# Local lexical variable names that are exempt from capitalization rules. The values here are regexes that will be surrounded by \A and \z. +# local_lexical_variable_exemptions = + +# How lexical variables that are scoped to a subset of subroutines, should be capitalized. Valid values are :single_case, :all_lower, :all_upper, :starts_with_lower, :starts_with_upper, :no_restriction, or a regex. +# scoped_lexical_variables = :single_case + +# Names for variables in anonymous blocks that are exempt from capitalization rules. The values here are regexes that will be surrounded by \A and \z. +# scoped_lexical_variable_exemptions = + +# How lexical variables at the file level should be capitalized. Valid values are :single_case, :all_lower, :all_upper, :starts_with_lower, :starts_with_upper, :no_restriction, or a regex. +# file_lexical_variables = :single_case + +# File-scope lexical variable names that are exempt from capitalization rules. The values here are regexes that will be surrounded by \A and \z. +# file_lexical_variable_exemptions = + +# How global (package) variables should be capitalized. Valid values are :single_case, :all_lower, :all_upper, :starts_with_lower, :starts_with_upper, :no_restriction, or a regex. +# global_variables = :single_case + +# Global variable names that are exempt from capitalization rules. The values here are regexes that will be surrounded by \A and \z. +# global_variable_exemptions = \$VERSION @ISA @EXPORT(?:_OK)? %EXPORT_TAGS \$AUTOLOAD %ENV %SIG \$TODO + +# How constant names should be capitalized. Valid values are :single_case, :all_lower, :all_upper, :starts_with_lower, :starts_with_upper, :no_restriction, or a regex. +# constants = :all_upper + +# Constant names that are exempt from capitalization rules. The values here are regexes that will be surrounded by \A and \z. +# constant_exemptions = + +# How labels should be capitalized. Valid values are :single_case, :all_lower, :all_upper, :starts_with_lower, :starts_with_upper, :no_restriction, or a regex. +# labels = :all_upper + +# Labels that are exempt from capitalization rules. The values here are regexes that will be surrounded by \A and \z. +# label_exemptions = + + +# Don't use vague variable or subroutine names like 'last' or 'record'. +[NamingConventions::ProhibitAmbiguousNames] +# set_themes = core maintenance pbp +# add_themes = +# severity = 3 +# maximum_violations_per_document = no_limit + +# The variable names that are not to be allowed. +# forbid = abstract bases close contract last left no record right second set + + +# Prohibit indirect object call syntax. +[Objects::ProhibitIndirectSyntax] +# set_themes = certrule core maintenance pbp +# add_themes = +# severity = 4 +# maximum_violations_per_document = no_limit + +# Indirect method syntax is forbidden for these methods. +# Values that are always included: new. +# forbid = + + +# Write `@{ $array_ref }' instead of `@$array_ref'. +[References::ProhibitDoubleSigils] +# set_themes = core cosmetic pbp +# add_themes = +# severity = 2 +# maximum_violations_per_document = no_limit + + +# Capture variable used outside conditional. +[RegularExpressions::ProhibitCaptureWithoutTest] +# set_themes = certrule core maintenance pbp +# add_themes = +# severity = 3 +# maximum_violations_per_document = no_limit + +# Names of ways to generate exceptions. +# Values that are always included: confess, croak, die. +# exception_source = + + +# Split long regexps into smaller `qr//' chunks. +[RegularExpressions::ProhibitComplexRegexes] +# set_themes = core maintenance pbp +# add_themes = +# severity = 3 +# maximum_violations_per_document = no_limit + +# The maximum number of characters to allow in a regular expression. +# Minimum value 1. No maximum. +# max_characters = 60 + + +# Use named character classes instead of explicit character lists. +[RegularExpressions::ProhibitEnumeratedClasses] +# set_themes = core cosmetic pbp unicode +# add_themes = +# severity = 1 +# maximum_violations_per_document = no_limit + + +# Use character classes for literal meta-characters instead of escapes. +[RegularExpressions::ProhibitEscapedMetacharacters] +# set_themes = core cosmetic pbp +# add_themes = +# severity = 1 +# maximum_violations_per_document = no_limit + + +# Use `eq' or hash instead of fixed-pattern regexps. +[RegularExpressions::ProhibitFixedStringMatches] +# set_themes = core pbp performance +# add_themes = +# severity = 2 +# maximum_violations_per_document = no_limit + + +# Use `[abc]' instead of `a|b|c'. +[RegularExpressions::ProhibitSingleCharAlternation] +# set_themes = core pbp performance +# add_themes = +# severity = 1 +# maximum_violations_per_document = no_limit + + +# Only use a capturing group if you plan to use the captured value. +[RegularExpressions::ProhibitUnusedCapture] +# set_themes = core maintenance pbp +# add_themes = +# severity = 3 +# maximum_violations_per_document = no_limit + + +# Use only `//' or `{}' to delimit regexps. +[RegularExpressions::ProhibitUnusualDelimiters] +# set_themes = core cosmetic pbp +# add_themes = +# severity = 1 +# maximum_violations_per_document = no_limit + +# In addition to allowing '{}', allow '()', '[]', and '{}'. +# allow_all_brackets = + + +# Don't use $_ to match against regexes. +[RegularExpressions::ProhibitUselessTopic] +# set_themes = core +# add_themes = +# severity = 2 +# maximum_violations_per_document = no_limit + + +# Use `{' and `}' to delimit multi-line regexps. +[RegularExpressions::RequireBracesForMultiline] +# set_themes = core cosmetic pbp +# add_themes = +# severity = 1 +# maximum_violations_per_document = no_limit + +# In addition to allowing '{}', allow '()', '[]', and '{}'. +# allow_all_brackets = + + +# Always use the `/s' modifier with regular expressions. +[RegularExpressions::RequireDotMatchAnything] +# set_themes = core cosmetic pbp +# add_themes = +# severity = 2 +# maximum_violations_per_document = no_limit + + +# Always use the `/x' modifier with regular expressions. +[RegularExpressions::RequireExtendedFormatting] +# set_themes = core maintenance pbp +# add_themes = +# severity = 3 +# maximum_violations_per_document = no_limit + +# The number of characters that a regular expression must contain before this policy will complain. +# Minimum value 0. No maximum. +# minimum_regex_length_to_complain_about = 0 + +# Should regexes that only contain whitespace and word characters be complained about?. +# strict = 0 + + +# Always use the `/m' modifier with regular expressions. +[RegularExpressions::RequireLineBoundaryMatching] +# set_themes = core cosmetic pbp +# add_themes = +# severity = 2 +# maximum_violations_per_document = no_limit + + +# Don't call functions with a leading ampersand sigil. +[Subroutines::ProhibitAmpersandSigils] +# set_themes = core maintenance pbp +# add_themes = +# severity = 2 +# maximum_violations_per_document = no_limit + + +# Don't declare your own `open' function. +[Subroutines::ProhibitBuiltinHomonyms] +# set_themes = bugs certrule core pbp +# add_themes = +# severity = 4 +# maximum_violations_per_document = no_limit + + +# Minimize complexity by factoring code into smaller subroutines. +[Subroutines::ProhibitExcessComplexity] +# set_themes = complexity core maintenance +# add_themes = +# severity = 3 +# maximum_violations_per_document = no_limit + +# The maximum complexity score allowed. +# Minimum value 1. No maximum. +# max_mccabe = 20 + + +# Return failure with bare `return' instead of `return undef'. [Subroutines::ProhibitExplicitReturnUndef] +# set_themes = bugs certrec core pbp +# add_themes = +# severity = 5 +# maximum_violations_per_document = no_limit + + +# Too many arguments. +[Subroutines::ProhibitManyArgs] +# set_themes = core maintenance pbp +# add_themes = +# severity = 3 +# maximum_violations_per_document = no_limit + +# The maximum number of arguments to allow a subroutine to have. +# Minimum value 1. No maximum. +# max_arguments = 5 + +# Don't count $self or $class first argument. +# skip_object = 0 + + +# `sub never { sub correct {} }'. +[Subroutines::ProhibitNestedSubs] +# set_themes = bugs core +# add_themes = +# severity = 5 +# maximum_violations_per_document = no_limit + + +# Behavior of `sort' is not defined if called in scalar context. +[Subroutines::ProhibitReturnSort] +# set_themes = bugs certrule core +# add_themes = +# severity = 5 +# maximum_violations_per_document = no_limit + + +# Don't write `sub my_function (@@) {}'. +[Subroutines::ProhibitSubroutinePrototypes] +# set_themes = bugs certrec core pbp +# add_themes = +# severity = 5 +# maximum_violations_per_document = no_limit + + +# Prevent unused private subroutines. +[Subroutines::ProhibitUnusedPrivateSubroutines] +# set_themes = certrec core maintenance +# add_themes = +# severity = 3 +# maximum_violations_per_document = no_limit + +# Pattern that determines what a private subroutine is. +# private_name_regex = \b_\w+\b + +# Subroutines matching the private name regex to allow under this policy. +# allow = + +# Modules that, if used within a file, will cause the policy to be disabled for this file. +# skip_when_using = + +# Pattern defining private subroutine names that are always allowed. +# allow_name_regex = + + +# Prevent access to private subs in other packages. +[Subroutines::ProtectPrivateSubs] +# set_themes = certrule core maintenance +# add_themes = +# severity = 3 +# maximum_violations_per_document = no_limit + +# Pattern that determines what a private subroutine is. +# private_name_regex = \b_\w+\b + +# Subroutines matching the private name regex to allow under this policy. +# Values that are always included: POSIX::_PC_CHOWN_RESTRICTED, POSIX::_PC_LINK_MAX, POSIX::_PC_MAX_CANON, POSIX::_PC_MAX_INPUT, POSIX::_PC_NAME_MAX, POSIX::_PC_NO_TRUNC, POSIX::_PC_PATH_MAX, POSIX::_PC_PIPE_BUF, POSIX::_PC_VDISABLE, POSIX::_POSIX_ARG_MAX, POSIX::_POSIX_CHILD_MAX, POSIX::_POSIX_CHOWN_RESTRICTED, POSIX::_POSIX_JOB_CONTROL, POSIX::_POSIX_LINK_MAX, POSIX::_POSIX_MAX_CANON, POSIX::_POSIX_MAX_INPUT, POSIX::_POSIX_NAME_MAX, POSIX::_POSIX_NGROUPS_MAX, POSIX::_POSIX_NO_TRUNC, POSIX::_POSIX_OPEN_MAX, POSIX::_POSIX_PATH_MAX, POSIX::_POSIX_PIPE_BUF, POSIX::_POSIX_SAVED_IDS, POSIX::_POSIX_SSIZE_MAX, POSIX::_POSIX_STREAM_MAX, POSIX::_POSIX_TZNAME_MAX, POSIX::_POSIX_VDISABLE, POSIX::_POSIX_VERSION, POSIX::_SC_ARG_MAX, POSIX::_SC_CHILD_MAX, POSIX::_SC_CLK_TCK, POSIX::_SC_JOB_CONTROL, POSIX::_SC_NGROUPS_MAX, POSIX::_SC_OPEN_MAX, POSIX::_SC_PAGESIZE, POSIX::_SC_SAVED_IDS, POSIX::_SC_STREAM_MAX, POSIX::_SC_TZNAME_MAX, POSIX::_SC_VERSION, POSIX::_exit. +# allow = + + +# Always unpack `@_' first. +[Subroutines::RequireArgUnpacking] +# set_themes = core maintenance pbp +# add_themes = +# severity = 4 +# maximum_violations_per_document = no_limit + +# The number of statements to allow without unpacking. +# Minimum value 0. No maximum. +# short_subroutine_statements = 0 + +# Should unpacking from array slices and elements be allowed?. +# allow_subscripts = 0 + +# Allow the usual delegation idiom to these namespaces/subroutines. +# Values that are always included: NEXT::, SUPER::. +# allow_delegation_to = + + +# End every path through a subroutine with an explicit `return' statement. +[Subroutines::RequireFinalReturn] +# set_themes = bugs certrec core pbp +# add_themes = +# severity = 4 +# maximum_violations_per_document = no_limit + +# The additional subroutines to treat as terminal. +# Values that are always included: ..., Carp::confess, Carp::croak, confess, croak, die, exec, exit, throw. +# terminal_funcs = + +# The additional methods to treat as terminal. +# Values that are always included: . +# terminal_methods = -# The violater of this is an overwrite for Class::Accessor -# REF: https://metacpan.org/pod/Perl::Critic::Policy::NamingConventions::ProhibitAmbiguousNames -[-NamingConventions::ProhibitAmbiguousNames] -# We are using Constants -# Perhaps exchange this for Readonly? -# REF: https://metacpan.org/pod/Perl::Critic::Policy::ValuesAndExpressions::ProhibitConstantPragma -[-ValuesAndExpressions::ProhibitConstantPragma] +# Prohibit various flavors of `no strict'. +[TestingAndDebugging::ProhibitNoStrict] +# set_themes = bugs certrec core pbp +# add_themes = +# severity = 5 +# maximum_violations_per_document = no_limit -# We currently utilize a package variable deliberately, should be addressed again -# REF: https://metacpan.org/pod/Perl::Critic::Policy::Variables::ProhibitPackageVars -[-Variables::ProhibitPackageVars] +# Allow vars, subs, and/or refs. +# allow = -# For embedded SQL this is perfectly ok -# REF: https://metacpan.org/pod/Perl::Critic::Policy::ValuesAndExpressions::ProhibitImplicitNewlines + +# Prohibit various flavors of `no warnings'. +[TestingAndDebugging::ProhibitNoWarnings] +# set_themes = bugs certrec core pbp +# add_themes = +# severity = 4 +# maximum_violations_per_document = no_limit + +# Permitted warning categories. +# allow = + +# Allow "no warnings" if it restricts the kinds of warnings that are turned off. +# allow_with_category_restriction = 0 + + +# Don't turn off strict for large blocks of code. +[TestingAndDebugging::ProhibitProlongedStrictureOverride] +# set_themes = bugs certrec core pbp +# add_themes = +# severity = 4 +# maximum_violations_per_document = no_limit + +# The maximum number of statements in a no strict block. +# Minimum value 1. No maximum. +# statements = 3 + + +# Tests should all have labels. +[TestingAndDebugging::RequireTestLabels] +# set_themes = core maintenance tests +# add_themes = +# severity = 3 +# maximum_violations_per_document = no_limit + +# The additional modules to require labels for. +# Values that are always included: Test::More. +# modules = + + +# Always `use strict'. +[TestingAndDebugging::RequireUseStrict] +# set_themes = bugs certrec certrule core pbp +# add_themes = +# severity = 5 +# maximum_violations_per_document = 1 + +# The additional modules to treat as equivalent to "strict". +# Values that are always included: Any::Moose, Dancer, Dancer2, Mo, Modern::Perl, Mojo::Base, Mojolicious::Lite, Moo, Moo::Role, Moos, Moose, Moose::Exporter, Moose::Role, Moose::Util::TypeConstraints, MooseX::NonMoose, MooseX::Role::Parameterized, MooseX::Singleton, Mouse, Mouse::Exporter, Mouse::Role, Mouse::Util, Mouse::Util::TypeConstraints, Mousse, Object::Simple, Role::Tiny, sane, shit, strict, strictures. +# equivalent_modules = + + +# Always `use warnings'. +[TestingAndDebugging::RequireUseWarnings] +# set_themes = bugs certrule core pbp +# add_themes = +# severity = 4 +# maximum_violations_per_document = 1 + +# The additional modules to treat as equivalent to "warnings". +# Values that are always included: Any::Moose, Dancer, Dancer2, Mo, Modern::Perl, Mojo::Base, Mojolicious::Lite, Moo, Moo::Role, Moos, Moose, Moose::Exporter, Moose::Role, Moose::Util::TypeConstraints, MooseX::NonMoose, MooseX::Role::Parameterized, MooseX::Singleton, Mouse, Mouse::Exporter, Mouse::Role, Mouse::Util, Mouse::Util::TypeConstraints, Mousse, Object::Simple, Role::Tiny, sane, shit, strictures, warnings. +# equivalent_modules = + + +# disallow bareword before < +[ValuesAndExpressions::ConstantBeforeLt] +# set_themes = bugs pulp +# add_themes = +# severity = 3 +# maximum_violations_per_document = no_limit + + +# logical not used with compare +[ValuesAndExpressions::NotWithCompare] +# set_themes = bugs pulp +# add_themes = +# severity = 3 +# maximum_violations_per_document = no_limit + + +# don't assign an anonymous arrayref to an array +[ValuesAndExpressions::ProhibitArrayAssignAref] +# set_themes = bugs pulp +# add_themes = +# severity = 3 +# maximum_violations_per_document = no_limit + + +# don't use Foo:: style barewords +[ValuesAndExpressions::ProhibitBarewordDoubleColon] +# set_themes = cosmetic pulp +# add_themes = +# severity = 1 +# maximum_violations_per_document = no_limit + +# Whether to allow double-colon in indirect object syntax "new Foo:: arg,arg". +# allow_indirect_syntax = 1 + + +# Don't use the comma operator as a statement separator. +[ValuesAndExpressions::ProhibitCommaSeparatedStatements] +# set_themes = bugs certrule core pbp +# add_themes = +# severity = 4 +# maximum_violations_per_document = no_limit + +# Allow map and grep blocks to return lists. +# allow_last_statement_to_be_comma_separated_in_map_and_grep = 0 + + +# Prohibit version values from outside the module. +[ValuesAndExpressions::ProhibitComplexVersion] +# set_themes = core maintenance +# add_themes = +# severity = 3 +# maximum_violations_per_document = no_limit + +# Make "use version; our $VERSION = qv('1.2.3');" a violation of this policy. +# forbid_use_version = 0 + + +# Don't `use constant FOO => 15'. +[ValuesAndExpressions::ProhibitConstantPragma] +# set_themes = bugs core pbp +# add_themes = +# severity = 4 +# maximum_violations_per_document = no_limit + + +# disallow duplicate literal hash keys +[ValuesAndExpressions::ProhibitDuplicateHashKeys] +# set_themes = bugs pulp +# add_themes = +# severity = 3 +# maximum_violations_per_document = no_limit + + +# disallow empty consecutive commas +[ValuesAndExpressions::ProhibitEmptyCommas] +# set_themes = cosmetic pulp +# add_themes = +# severity = 2 +# maximum_violations_per_document = no_limit + + +# Write `q{}' instead of `'''. +[ValuesAndExpressions::ProhibitEmptyQuotes] +# set_themes = core cosmetic pbp +# add_themes = +# severity = 2 +# maximum_violations_per_document = no_limit + + +# Write `"\N{DELETE}"' instead of `"\x7F"', etc. +[ValuesAndExpressions::ProhibitEscapedCharacters] +# set_themes = core cosmetic pbp +# add_themes = +# severity = 2 +# maximum_violations_per_document = no_limit + + +# don't use the -f file test +[ValuesAndExpressions::ProhibitFiletest_f] +# set_themes = bugs pulp +# add_themes = +# severity = 3 +# maximum_violations_per_document = no_limit + + +# Use concatenation or HEREDOCs instead of literal line breaks in strings. [ValuesAndExpressions::ProhibitImplicitNewlines] +# set_themes = core cosmetic pbp +# add_themes = +# severity = 3 +# maximum_violations_per_document = no_limit + + +# Always use single quotes for literal strings. +[ValuesAndExpressions::ProhibitInterpolationOfLiterals] +# set_themes = core cosmetic pbp +# add_themes = +# severity = 1 +# maximum_violations_per_document = no_limit + +# Kinds of delimiters to permit, e.g. "qq{", "qq(", "qq[", "qq/". +# allow = + +# If the string contains ' characters, allow "" to quote it. +# allow_if_string_contains_single_quote = 0 + + +# Write `oct(755)' instead of `0755'. +[ValuesAndExpressions::ProhibitLeadingZeros] +# set_themes = bugs certrec core pbp +# add_themes = +# severity = 5 +# maximum_violations_per_document = no_limit + +# Don't allow any leading zeros at all. Otherwise builtins that deal with Unix permissions, e.g. chmod, don't get flagged. +# strict = 0 + + +# Long chains of method calls indicate tightly coupled code. +[ValuesAndExpressions::ProhibitLongChainsOfMethodCalls] +# set_themes = core maintenance +# add_themes = +# severity = 2 +# maximum_violations_per_document = no_limit + +# The number of chained calls to allow. +# Minimum value 1. No maximum. +# max_chain_length = 3 + + +# Don't use values that don't explain themselves. +[ValuesAndExpressions::ProhibitMagicNumbers] +# set_themes = certrec core maintenance +# add_themes = +# severity = 2 +# maximum_violations_per_document = 10 + +# Individual and ranges of values to allow, and/or "all_integers". +# allowed_values = 0 1 2 + +# Kind of literals to allow. +# Valid values: Binary, Exp, Float, Hex, Octal. +# allowed_types = Float + +# Should anything to the right of a "=>" be allowed?. +# allow_to_the_right_of_a_fat_comma = 1 + +# Names of subroutines that create constants. +# Values that are always included: Readonly, Readonly::Array, Readonly::Hash, Readonly::Scalar, const. +# constant_creator_subroutines = + + +# Don't mix numeric operators with string operands, or vice-versa. +[ValuesAndExpressions::ProhibitMismatchedOperators] +# set_themes = bugs certrule core +# add_themes = +# severity = 3 +# maximum_violations_per_document = no_limit + + +# Write ` !$foo && $bar || $baz ' instead of ` not $foo && $bar or $baz'. +[ValuesAndExpressions::ProhibitMixedBooleanOperators] +# set_themes = bugs certrec core pbp +# add_themes = +# severity = 4 +# maximum_violations_per_document = no_limit + + +# Use `q{}' or `qq{}' instead of quotes for awkward-looking strings. +[ValuesAndExpressions::ProhibitNoisyQuotes] +# set_themes = core cosmetic pbp +# add_themes = +# severity = 2 +# maximum_violations_per_document = no_limit + + +# disallow empty statements (stray semicolons) +[ValuesAndExpressions::ProhibitNullStatements] +# set_themes = cosmetic pulp +# add_themes = +# severity = 3 +# maximum_violations_per_document = no_limit + +# Whether to allow Perl 4 style ";#" comments. +# allow_perl4_semihash = 0 + + +# Don't use quotes (`'', `"', ``') as delimiters for the quote-like operators. +[ValuesAndExpressions::ProhibitQuotesAsQuotelikeOperatorDelimiters] +# set_themes = core maintenance +# add_themes = +# severity = 3 +# maximum_violations_per_document = no_limit + +# The operators to allow single-quotes as delimiters for. +# Valid values: m, q, qq, qr, qw, qx, s, tr, y. +# single_quote_allowed_operators = m s qr qx + +# The operators to allow double-quotes as delimiters for. +# Valid values: m, q, qq, qr, qw, qx, s, tr, y. +# double_quote_allowed_operators = + +# The operators to allow back-quotes (back-ticks) as delimiters for. +# Valid values: m, q, qq, qr, qw, qx, s, tr, y. +# back_quote_allowed_operators = + + +# Don't write ` print <<'__END__' '. +[ValuesAndExpressions::ProhibitSpecialLiteralHeredocTerminator] +# set_themes = core maintenance +# add_themes = +# severity = 3 +# maximum_violations_per_document = no_limit + + +# don't use undefined backslash forms +[ValuesAndExpressions::ProhibitUnknownBackslash] +# set_themes = cosmetic pulp +# add_themes = +# severity = 3 +# maximum_violations_per_document = no_limit + +# Checking of single-quote strings. +# single = none + +# Checking of double-quote strings. +# double = all + +# Checking of interpolated here-documents. +# heredoc = all + +# Checking of character names \N{}. +# charnames = version + + +# Don't use strings like `v1.4' or `1.4.5' when including other modules. +[ValuesAndExpressions::ProhibitVersionStrings] +# set_themes = core maintenance pbp +# add_themes = +# severity = 3 +# maximum_violations_per_document = no_limit + + +# Require $VERSION to be a constant rather than a computed value. +[ValuesAndExpressions::RequireConstantVersion] +# set_themes = core maintenance +# add_themes = +# severity = 2 +# maximum_violations_per_document = no_limit + +# Allow qv() and version->new() without a 'use version' on the same line. +# allow_version_without_use_on_same_line = 0 + + +# Warns that you might have used single quotes when you really wanted double-quotes. +[ValuesAndExpressions::RequireInterpolationOfMetachars] +# set_themes = core cosmetic pbp +# add_themes = +# severity = 1 +# maximum_violations_per_document = no_limit + +# RCS keywords to ignore in potential interpolation. +# rcs_keywords = + + +# Write ` 141_234_397.0145 ' instead of ` 141234397.0145 '. +[ValuesAndExpressions::RequireNumberSeparators] +# set_themes = core cosmetic pbp +# add_themes = +# severity = 2 +# maximum_violations_per_document = no_limit + +# The minimum absolute value to require separators in. +# Minimum value 10. No maximum. +# min_value = 10_000 + + +# $VERSION a plain number +[ValuesAndExpressions::RequireNumericVersion] +# set_themes = bugs pulp +# add_themes = +# severity = 3 +# maximum_violations_per_document = no_limit + + +# Write ` print <<'THE_END' ' or ` print <<"THE_END" '. +[ValuesAndExpressions::RequireQuotedHeredocTerminator] +# set_themes = core maintenance pbp +# add_themes = +# severity = 3 +# maximum_violations_per_document = no_limit + + +# Write ` <<'THE_END'; ' instead of ` <<'theEnd'; '. +[ValuesAndExpressions::RequireUpperCaseHeredocTerminator] +# set_themes = core cosmetic pbp +# add_themes = +# severity = 2 +# maximum_violations_per_document = no_limit + + +# specials like __PACKAGE__ used literally +[ValuesAndExpressions::UnexpandedSpecialLiteral] +# set_themes = bugs pulp +# add_themes = +# severity = 3 +# maximum_violations_per_document = no_limit + + +# Do not write ` my $foo .= 'bar'; '. +[Variables::ProhibitAugmentedAssignmentInDeclaration] +# set_themes = bugs core +# add_themes = +# severity = 4 +# maximum_violations_per_document = no_limit + + +# Do not write ` my $foo = $bar if $baz; '. +[Variables::ProhibitConditionalDeclarations] +# set_themes = bugs core +# add_themes = +# severity = 5 +# maximum_violations_per_document = no_limit + + +# Use `my' instead of `local', except when you have to. +[Variables::ProhibitLocalVars] +# set_themes = core maintenance pbp +# add_themes = +# severity = 2 +# maximum_violations_per_document = no_limit + + +# Don't write loops on hashes, only on keys and values of hashes +[Variables::ProhibitLoopOnHash] +# set_themes = bugs +# add_themes = +# severity = 4 +# maximum_violations_per_document = no_limit + + +# Avoid `$`', `$&', `$'' and their English equivalents. +[Variables::ProhibitMatchVars] +# set_themes = core pbp performance +# add_themes = +# severity = 4 +# maximum_violations_per_document = no_limit + + +# Eliminate globals declared with `our' or `use vars'. +[Variables::ProhibitPackageVars] +# set_themes = core maintenance pbp +# add_themes = +# severity = 3 +# maximum_violations_per_document = no_limit + +# The base set of packages to allow variables for. +# packages = Data::Dumper File::Find FindBin Log::Log4perl + +# The set of packages to allow variables for, in addition to those given in "packages". +# add_packages = + + +# Use double colon (::) to separate package name components instead of single quotes ('). +[Variables::ProhibitPerl4PackageNames] +# set_themes = certrec core maintenance +# add_themes = +# severity = 2 +# maximum_violations_per_document = no_limit + + +# Write `$EVAL_ERROR' instead of `$@'. +[Variables::ProhibitPunctuationVars] +# set_themes = core cosmetic pbp +# add_themes = +# severity = 2 +# maximum_violations_per_document = no_limit + +# The additional variables to allow. +# Values that are always included: $1, $2, $3, $4, $5, $6, $7, $8, $9, $], $_, @_, _. +# allow = + +# Controls checking interpolated strings for punctuation variables. +# Valid values: disable, simple, thorough. +# string_mode = thorough + + +# Do not reuse a variable name in a lexical scope +[Variables::ProhibitReusedNames] +# set_themes = bugs core +# add_themes = +# severity = 3 +# maximum_violations_per_document = no_limit + +# The variables to not consider as duplicates. +# allow = $self $class + + +# Don't ask for storage you don't need. +[Variables::ProhibitUnusedVariables] +# set_themes = certrec core maintenance +# add_themes = +# severity = 3 +# maximum_violations_per_document = no_limit -# Exchange for Module::Load or Module::Runtime? -# REF: https://metacpan.org/pod/Perl::Critic::Policy::BuiltinFunctions::ProhibitStringyEval -[-BuiltinFunctions::ProhibitStringyEval] -# We use log -# REF: https://metacpan.org/pod/Perl::Critic::Policy::Subroutines::ProhibitBuiltinHomonyms -[-Subroutines::ProhibitBuiltinHomonyms] +# Prevent access to private vars in other packages. +[Variables::ProtectPrivateVars] +# set_themes = certrule core maintenance +# add_themes = +# severity = 3 +# maximum_violations_per_document = no_limit -#------------------------------------------------------------------------------ -# TODO +# Write `local $foo = $bar;' instead of just `local $foo;'. +[Variables::RequireInitializationForLocalVars] +# set_themes = bugs certrec core pbp +# add_themes = +# severity = 3 +# maximum_violations_per_document = no_limit -# REF: https://metacpan.org/pod/Perl::Critic::Policy::TestingAndDebugging::ProhibitNoStrict -[-TestingAndDebugging::ProhibitNoStrict] -# REF: https://metacpan.org/pod/Perl::Critic::Policy::TestingAndDebugging::ProhibitProlongedStrictureOverride -[-TestingAndDebugging::ProhibitProlongedStrictureOverride] +# Write `for my $element (@list) {...}' instead of `for $element (@list) {...}'. +[Variables::RequireLexicalLoopIterators] +# set_themes = bugs certrec core pbp +# add_themes = +# severity = 5 +# maximum_violations_per_document = no_limit -# REF: https://metacpan.org/pod/Perl::Critic::Policy::InputOutput::ProhibitBarewordFileHandles -[-InputOutput::ProhibitBarewordFileHandles] -# REF: https://metacpan.org/pod/Perl::Critic::Policy::Subroutines::RequireFinalReturn -[-Subroutines::RequireFinalReturn] +# Magic variables should be assigned as "local". +[Variables::RequireLocalizedPunctuationVars] +# set_themes = bugs certrec core pbp +# add_themes = +# severity = 4 +# maximum_violations_per_document = no_limit -# REF: https://metacpan.org/pod/Perl::Critic::Policy::Subroutines::RequireArgUnpacking -[-Subroutines::RequireArgUnpacking] +# Global variables to exclude from this policy. +# Values that are always included: $ARG, $_, @_. +# allow = -# REF: https://metacpan.org/pod/Perl::Critic::Policy::InputOutput::RequireBriefOpen -[-InputOutput::RequireBriefOpen] -# REF: https://metacpan.org/pod/Perl::Critic::Policy::ValuesAndExpressions::ProhibitCommaSeparatedStatements -[-ValuesAndExpressions::ProhibitCommaSeparatedStatements] +# Negative array index should be used. +[Variables::RequireNegativeIndices] +# set_themes = core maintenance pbp +# add_themes = +# severity = 4 +# maximum_violations_per_document = no_limit