Re: run pgindent on a regular basis / scripted manner - Mailing list pgsql-hackers

From Andrew Dunstan
Subject Re: run pgindent on a regular basis / scripted manner
Date
Msg-id 3ccb06d5-a6a6-df1b-b4b5-940765a11e93@dunslane.net
Whole thread Raw
In response to Re: run pgindent on a regular basis / scripted manner  (Bruce Momjian <bruce@momjian.us>)
Responses Re: run pgindent on a regular basis / scripted manner  (Tom Lane <tgl@sss.pgh.pa.us>)
List 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

pgsql-hackers by date:

Previous
From: Andrew Dunstan
Date:
Subject: Re: run pgindent on a regular basis / scripted manner
Next
From: Tom Lane
Date:
Subject: Re: run pgindent on a regular basis / scripted manner