Re: perlcritic and perltidy

From: Andrew Dunstan <andrew(dot)dunstan(at)2ndquadrant(dot)com>
To: Stephen Frost <sfrost(at)snowman(dot)net>
Cc: David Steele <david(at)pgmasters(dot)net>, Michael Paquier <michael(at)paquier(dot)xyz>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: perlcritic and perltidy
Date: 2018-05-08 17:17:07
Message-ID: 08cba2fd-63ae-f7c2-2c17-49cac8650ac6@2ndQuadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 05/08/2018 12:51 PM, Stephen Frost wrote:
> Greetings,
>
> * Andrew Dunstan (andrew(dot)dunstan(at)2ndquadrant(dot)com) wrote:
>> On 05/08/2018 10:06 AM, Andrew Dunstan wrote:
>>> {         find . -type f -a \( -name
>>> '*.pl' -o -name '*.pm' \) -print;         find . -type f -perm -100
>>> -exec file {} \; -print                | egrep -i
>>> ':.*perl[0-9]*\>'                | cut -d: -f1;     }     | sort -u  |
>>> xargs perlcritic --quiet --single CodeLayout::RequireTrailingCommas
>> Here's a diff of all the places it found fixed. At this stage I don't
>> think it's worth it. If someone wants to write a perlcritic policy that
>> identifies missing trailing commas reasonably comprehensively, we can
>> look again. Otherwise we should just clean them up as we come across them.
> [...]
>> diff --git a/src/backend/catalog/Catalog.pm b/src/backend/catalog/Catalog.pm
>> index f387c86..ac19682 100644
>> --- a/src/backend/catalog/Catalog.pm
>> +++ b/src/backend/catalog/Catalog.pm
>> @@ -34,7 +34,7 @@ sub ParseHeader
>> 'Oid' => 'oid',
>> 'NameData' => 'name',
>> 'TransactionId' => 'xid',
>> - 'XLogRecPtr' => 'pg_lsn');
>> + 'XLogRecPtr' => 'pg_lsn',);
>>
>> my %catalog;
>> my $declaring_attributes = 0;
> There's not much point adding the ',' unless you're also putting the
> ');' on the next line, is there..?

No, not really.

>
> Or is that going to be handled in a follow-up patch?
>

No, the current proposal is to keep the vertical tightness settings for
parentheses, which is precisely this set of cases, because otherwise
there are some ugly code efects (see Peter's email upthread)

So I think we're all in agreement to fortget this trailing comma thing.

cheers

andrew

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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Stephen Frost 2018-05-08 17:18:58 Re: perlcritic and perltidy
Previous Message Stephen Frost 2018-05-08 17:06:42 Re: perlcritic and perltidy