Re: pgsql: Fix perltidy breaking perlcritic

Andrew Dunstan <andrew@dunslane.net>

From: Andrew Dunstan <andrew@dunslane.net>
To: Alvaro Herrera <alvherre@alvh.no-ip.org>
Cc: pgsql-committers@lists.postgresql.org
Date: 2022-09-08T20:32:14Z
Lists: pgsql-hackers
On Thu, Sep 8, 2022 at 5:23 AM Alvaro Herrera <alvherre@alvh.no-ip.org>
wrote:

> Fix perltidy breaking perlcritic
>
> perltidying a "##no critic" line moves the marker to where it becomes
> useless.  Put the line back to how it was, and protect it from further
> malfeasance.
>
>
>
A better way do do this IMNSHO is to put the eval in a block on its own
along with the no critic marker on its own line, like this:

{
   ## no critic (ProhibitStringyEval)
   eval ...
}

perlcritic respects block boundaries for its directives.

cheers

andrew

Commits

  1. Make eval statement naturally proof against perltidy

  2. Fix perltidy breaking perlcritic