Re: pgsql: Fix precedence problem in new Perl code.

From: Andrew Dunstan <andrew(dot)dunstan(at)2ndquadrant(dot)com>
To: Mike Blackwell <mike(dot)blackwell(at)rrd(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-committers <pgsql-committers(at)lists(dot)postgresql(dot)org>
Subject: Re: pgsql: Fix precedence problem in new Perl code.
Date: 2018-05-05 11:43:33
Message-ID: CAA8=A78g53MV2=NdSZaq68ecTJhmKZPrY-5mAOZOFKhpFD3coA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers pgsql-hackers

On Fri, May 4, 2018 at 5:28 PM, Mike Blackwell <mike(dot)blackwell(at)rrd(dot)com> wrote:
> I didn't see a .perlcriticrc file in the project, so ran with our local
> settings.
>
> With those, perlcritic is pretty unhappy, even at -4, though I don't see
> anything that pops out as potentially bug-inducing. The ones I'd probably
> look fixing at for starters would be the two argument form of open, and
> maybe the .pl files without a #! so perlcritic doesn't mistake them for .pm
> files.
>
> It's also pretty noisy about the possible confusion cause by using a leading
> zero for octal vs oct(), though that's been common practice as far back as
> my memory goes. Those could be silenced in an rc file if that's preferred.
>
> If there's interest I could put together a patch for some or all of this.
>

(Please don't top-post, it violates our mailcritic policy)

There's been discussion about it before. The consensus was that we
don't care about a good many of the things perlcritic consider to be
very severe, e.g. two-argument open, which is an old and widely used
idiom that I at least have never had any problems with.

Also, I was more than amused yesterday when looking at it against the
buildfarm client code when I got this:

Fatal error while critiquing "./run_build.pl": Not an ARRAY reference
at /usr/share/perl5/vendor_perl/Perl/Critic/Policy/BuiltinFunctions/ProhibitUselessTopic.pm
line 81.

Oh, the irony.

cheers

andrew

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

In response to

Browse pgsql-committers by date

  From Date Subject
Next Message Peter Eisentraut 2018-05-05 15:18:03 pgsql: Remove extra newlines after PQerrorMessage()
Previous Message Christian Ullrich 2018-05-05 04:12:15 RE: pgsql: Provide for testing on python3 modules when under MSVC

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Kapila 2018-05-05 12:56:34 Re: Explain buffers wrong counter with parallel plans
Previous Message Yura Sokolov 2018-05-05 08:25:05 Re: [HACKERS] Clock with Adaptive Replacement