Re: cleaning perl code
Andrew Dunstan <andrew.dunstan@2ndquadrant.com>
From: Andrew Dunstan <andrew.dunstan@2ndquadrant.com>
To: Noah Misch <noah@leadboat.com>
Cc: PostgreSQL-development <pgsql-hackers@postgresql.org>
Date: 2020-04-14T15:57:01Z
Lists: pgsql-hackers
Attachments
- perlcritic-brutal (text/plain)
On 4/13/20 12:47 PM, Andrew Dunstan wrote: > > OK, I've committed all that stuff. I think that takes care of the > non-controversial part of what I proposed :-) > > OK, it seems there is a majority of people commenting in this thread in favor of not doing more except to reverse the policy of requiring subroutine returns. I'll do that shortly. In the spirit of David Steele's contribution, here is a snippet that when added to the perlcriticrc would allow us to pass at the "brutal" setting (severity 1). But I'm not proposing to add this, it's just here so anyone interested can see what's involved. One of the things that's a bit sad is that perlcritic doesn't generally let you apply policies to a given set of files or files matching some pattern. It would be nice, for instance, to be able to apply some additional standards to strategic library files like PostgresNode.pm, TestLib.pm and Catalog.pm. There are good reasons as suggested upthread to apply higher standards to library files than to, say, a TAP test script. The only easy way I can see to do that would be to have two different perlcriticrc files and adjust pgperlcritic to make two runs. If people think that's worth it I'll put a little work into it. If not, I'll just leave things here. cheers andrew -- Andrew Dunstan https://www.2ndQuadrant.com PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
Commits
-
Stop requiring an explicit return from perl subroutines
- 0516f94d18c5 13.0 landed
-
Use perl's $/ more idiomatically
- 8f00d84afc0d 13.0 landed
-
Use perl warnings pragma consistently
- 7be5d8df1f74 13.0 landed