Re: perlcritic

From: Noah Misch <noah(at)leadboat(dot)com>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Andrew Dunstan <andrew(at)dunslane(dot)net>, Peter Eisentraut <peter_e(at)gmx(dot)net>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: perlcritic
Date: 2015-09-02 05:13:43
Message-ID: 20150902051343.GA2944697@tornado.leadboat.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Sep 01, 2015 at 11:26:27AM -0400, Robert Haas wrote:
> On Tue, Sep 1, 2015 at 9:58 AM, Andrew Dunstan <andrew(at)dunslane(dot)net> wrote:
> > On 08/31/2015 11:57 PM, Peter Eisentraut wrote:
> >> We now have 80+ Perl files in our tree, and it's growing. Some of those
> >> files were originally written for Perl 4, and the coding styles and
> >> quality are quite, uh, divergent. So I figured it's time to clean up
> >> that code a bit. I ran perlcritic over the tree and cleaned up all the
> >> warnings at level 5 (the default, least severe).
> >
> > I don't object to this. Forcing strict mode is good, and I think I stopped
> > using bareword file handles around 17 years ago.
>
> FWIW, I think perlcritic is both useless and annoying. I've always
> used bareword file handles, and I don't really see what the problem
> with it is, especially in very short script files.

A bareword file handle is a form of global variable, so the criticism is
helpful for codebases large enough to make those a maintenance problem. It's
important for any CPAN module, so I can understand perlcritic including it.
Plenty of uses in our tree are fine.

> And what's wrong
> with two-argument form of open, if the path is a constant rather than
> possibly-tainted user input? Perl advertises that TMTOWTDI, and then
> perlcritic complains about which one you picked, mostly AFAICS for no
> particularly compelling reason. So I'm pretty meh about this whole
> exercise, especially if we follow it up by cleaning up the lower
> levels of warnings which, from what I can see, are unnecessary
> pedantry on top of unnecessary pedantry.
>
> But I suspect I'm in the minority here, so feel free to ignore me. (I
> certainly do agree that use strict and use warnings are a good thing
> to use everywhere. It's just perlcritic I dislike.)

I agree with the rest of your message.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Langote 2015-09-02 05:28:44 Re: Horizontal scalability/sharding
Previous Message Michael Paquier 2015-09-02 04:59:28 Re: Fwd: Core dump with nested CREATE TEMP TABLE