Skip to content

Commit

Permalink
[codingstd]
Browse files Browse the repository at this point in the history
Relax one of the not-yet passing perlcritic rules slightly



git-svn-id: https://svn.parrot.org/parrot/trunk@26593 d31e2699-5ff4-0310-a27c-f18f2fbe73fe
  • Loading branch information
coke committed Mar 28, 2008
1 parent e584332 commit 462d037
Showing 1 changed file with 17 additions and 7 deletions.
24 changes: 17 additions & 7 deletions t/codingstd/perlcritic.t
Expand Up @@ -106,6 +106,10 @@ if ( keys %policies ) {
# if the policy is passed in on the command line, and it's one of the
# ones where we require certain config arguments, then set them to the
# ones we want here.

# XXX this information is being duplicated, we should only specify the
# perltidyrc once, e.g.

if ( grep /CodeLayout::RequireTidyCode/, @input_policies ) {
$policies{'CodeLayout::RequireTidyCode'} = { perltidyrc => $perl_tidy_conf };
}
Expand All @@ -114,8 +118,8 @@ if ( keys %policies ) {
}
}
else {

# otherwise, just run perlcritic.t normally

my %default_policies = (
'BuiltinFunctions::ProhibitStringySplit' => 1,
'CodeLayout::ProhibitDuplicateCoda' => 1,
Expand All @@ -133,13 +137,19 @@ else {
'Variables::ProhibitConditionalDeclarations' => 1,
);

# add other policies which aren't yet passing consistently see RT#42427
# Allow some names normally proscribed by PBP.
my @ambiguousNames = grep {$_ ne 'abstract'}
Perl::Critic::Policy::NamingConventions::ProhibitAmbiguousNames::default_forbidden_words();

# These policies are not yet passing consistently.
my %extra_policies = (
'CodeLayout::RequireTidyCode' => { perltidyrc => $perl_tidy_conf },
'NamingConventions::ProhibitAmbiguousNames' => 1,
'Subroutines::ProhibitBuiltinHomonyms' => 1,
'Subroutines::ProhibitSubroutinePrototypes' => 1,
'Subroutines::RequireFinalReturn' => 1,
'CodeLayout::RequireTidyCode' =>
{ perltidyrc => $perl_tidy_conf },
'NamingConventions::ProhibitAmbiguousNames' =>
{ forbid => join(" ", @ambiguousNames)},
'Subroutines::ProhibitBuiltinHomonyms' => 1,
'Subroutines::ProhibitSubroutinePrototypes' => 1,
'Subroutines::RequireFinalReturn' => 1,
);

# Add Perl::Critic::Bangs if it exists
Expand Down

0 comments on commit 462d037

Please sign in to comment.