perlcritic script - Mailing list pgsql-hackers

From Andrew Dunstan
Subject perlcritic script
Date
Msg-id 86aa2a3a-0c68-21fb-9560-84ad6914d561@2ndQuadrant.com
Whole thread Raw
Responses Re: perlcritic script  (Peter Eisentraut <peter.eisentraut@2ndquadrant.com>)
List pgsql-hackers

Here's a small patch to add a script to call perlcritic, in the same way
that we have a script to call perltidy. Is also includes a perlcriticrc
file containing a policy to allow octal constants with leading zeros.
That's the only core severity 5 policy we are currently no in compliance
with.


We should probably look at being rather more aggressive with perlcritic.
I've made the buildfarm client code compliant with some exceptions down
to severity level 3. Here are the profile exceptions:

    [-Variables::RequireLocalizedPunctuationVars]
    [TestingAndDebugging::ProhibitNoWarnings]
    allow = once
    [-InputOutput::RequireBriefOpen]
    [-Subroutines::RequireArgUnpacking]
    [-RegularExpressions::RequireExtendedFormatting]
    [-Variables::ProhibitPackageVars]
    [-ErrorHandling::RequireCarping]
    [-ValuesAndExpressions::ProhibitComplexVersion]
    [InputOutput::ProhibitBacktickOperators]
    only_in_void_context = 1
    [-Modules::ProhibitExcessMainComplexity]
    [-Subroutines::ProhibitExcessComplexity]
    [-ValuesAndExpressions::ProhibitImplicitNewlines]
    [-ControlStructures::ProhibitCascadingIfElse]
    [-ControlStructures::ProhibitNegativeExpressionsInUnlessAndUntilConditions]
    [-ErrorHandling::RequireCheckingReturnValueOfEval ]
    [-BuiltinFunctions::ProhibitComplexMappings]

There are also 21 places in the code with "no critic" markings at
severity 3 and above.


cheers


andrew


-- 
Andrew Dunstan                https://www.2ndQuadrant.com
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services


Attachment

pgsql-hackers by date:

Previous
From: Stephen Frost
Date:
Subject: Re: perlcritic and perltidy
Next
From: Fabien COELHO
Date:
Subject: Re: [HACKERS] WIP Patch: Pgbench Serialization and deadlock errors