pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Andrew Dunstan <andrew.dunstan@2ndquadrant.com>
Cc: Noah Misch <noah@leadboat.com>
Cc: PostgreSQL-development <pgsql-hackers@postgresql.org>
Subject: Re: cleaning perl code
Date: Sat, 11 Apr 2020 13:31:16 -0400
Message-ID: <21773.1586626276@sss.pgh.pa.us> (raw)
In-Reply-To: <52405073-d836-6edb-b09a-681c59d18387@2ndQuadrant.com>
References: <e56f6fb6-38d5-8450-577c-24eb5d63f2e1@2ndQuadrant.com>
	<20200411043014.GA590991@rfd.leadboat.com>
	<0a4406d5-b428-4831-8ed9-c36764360f57@2ndQuadrant.com>
	<19843.1586623730@sss.pgh.pa.us>
	<52405073-d836-6edb-b09a-681c59d18387@2ndQuadrant.com>

Andrew Dunstan <andrew.dunstan@2ndquadrant.com> writes:
> On 4/11/20 12:48 PM, Tom Lane wrote:
>> Is there a way to modify the test so that it only complains when
>> the final return is missing and there are other return(s) with values?
>> That would seem like a more narrowly tailored check.

> Not AFAICS:
> <https://metacpan.org/pod/Perl::Critic::Policy::Subroutines::RequireFinalReturn;

Yeah, the list of all policies in the parent page doesn't offer any
promising alternatives either :-(

BTW, this bit in the policy's man page seems pretty disheartening:

    Be careful when fixing problems identified by this Policy; don't
    blindly put a return; statement at the end of every subroutine.

since I'd venture that's *exactly* what we've done every time perlcritic
moaned about this.  I wonder what else the author expected would happen.

> That would probably require writing a replacement module. Looking at the
> source if this module I think it might be possible, although I don't
> know much of the internals of perlcritic.

I doubt we want to go maintaining our own perlcritic policies; aside from
the effort involved, it'd become that much harder for anyone to reproduce
the results.

			regards, tom lane





view thread (34+ messages)  latest in thread

Message-ID: <21773.1586626276@sss.pgh.pa.us>
Permalink:  ../21773.1586626276@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/21773.1586626276@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: tgl@sss.pgh.pa.us, andrew.dunstan@2ndquadrant.com, noah@leadboat.com
  Subject: Re: cleaning perl code
  In-Reply-To: <21773.1586626276@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox