perlcritic script

From: Andrew Dunstan <andrew(dot)dunstan(at)2ndquadrant(dot)com>
To: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: perlcritic script
Date: 2018-05-08 17:57:47
Message-ID: 86aa2a3a-0c68-21fb-9560-84ad6914d561@2ndQuadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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 Content-Type Size
0001-Add-a-script-and-a-config-file-to-run-perlcritic.patch text/x-patch 1.9 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Fabien COELHO 2018-05-08 19:22:14 Re: [HACKERS] WIP Patch: Pgbench Serialization and deadlock errors
Previous Message Stephen Frost 2018-05-08 17:41:51 Re: perlcritic and perltidy