Re: run pgindent on a regular basis / scripted manner

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Bruce Momjian <bruce(at)momjian(dot)us>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Peter Eisentraut <peter(dot)eisentraut(at)enterprisedb(dot)com>, Jelte Fennema <postgres(at)jeltef(dot)nl>, "shiy(dot)fnst(at)fujitsu(dot)com" <shiy(dot)fnst(at)fujitsu(dot)com>, Robert Haas <robertmhaas(at)gmail(dot)com>, Justin Pryzby <pryzby(at)telsasoft(dot)com>, Andres Freund <andres(at)anarazel(dot)de>, Noah Misch <noah(at)leadboat(dot)com>, Peter Geoghegan <pg(at)bowt(dot)ie>, Magnus Hagander <magnus(at)hagander(dot)net>, Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, Stephen Frost <sfrost(at)snowman(dot)net>, Jesse Zhang <sbjesse(at)gmail(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: run pgindent on a regular basis / scripted manner
Date: 2023-04-30 13:02:04
Message-ID: 3ccb06d5-a6a6-df1b-b4b5-940765a11e93@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


On 2023-04-28 Fr 14:08, Bruce Momjian wrote:
> On Wed, Apr 26, 2023 at 03:44:47PM -0400, Andrew Dunstan wrote:
>> On 2023-04-26 We 09:27, Tom Lane wrote:
>> I doubt there's something like that. You can freeze arbitrary blocks of code
>> like this (from the manual)
>>
>> #<<<  format skipping: do not let perltidy change my nice formatting
>>         my @list = (1,
>>                     1, 1,
>>                     1, 2, 1,
>>                     1, 3, 3, 1,
>>                     1, 4, 6, 4, 1,);
>> #>>>
>>
>>
>> But that gets old and ugly pretty quickly.
> Can those comments be added by a preprocessor before calling perltidy,
> and then removed on completion?
>

I imagine so, but we'd need a way of determining algorithmically which
lines to protect. That might not be at all simple. And then we'd have
the maintenance burden of the preprocessor.

cheers

andrew

--
Andrew Dunstan
EDB:https://www.enterprisedb.com

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2023-04-30 14:32:16 Re: run pgindent on a regular basis / scripted manner
Previous Message Andrew Dunstan 2023-04-30 12:57:39 Re: run pgindent on a regular basis / scripted manner