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

From Tom Lane
Subject Re: run pgindent on a regular basis / scripted manner
Date
Msg-id 530189.1691880417@sss.pgh.pa.us
Whole thread Raw
In response to Re: run pgindent on a regular basis / scripted manner  (Andres Freund <andres@anarazel.de>)
Responses Re: run pgindent on a regular basis / scripted manner
List pgsql-hackers
Andres Freund <andres@anarazel.de> writes:
> On 2023-08-12 17:03:37 -0400, Andrew Dunstan wrote:
>> My recollection is that missing typedefs cause indentation that kinda sticks
>> out like a sore thumb.

Yeah, it's usually pretty obvious: "typedef *var" gets changed to
"typedef * var", and similar oddities.

> It's a somewhat annoying task though, find all the typedefs, add them to the
> right place in the file (we have an out of order entry right now). I think a
> script that *adds* (but doesn't remove) local typedefs would make this less
> painful.

My practice has always been "add typedefs until pgindent doesn't do
anything I don't want".  If you have a new typedef that doesn't happen
to be used in a way that pgindent mangles, it's not that critical
to get it into the file right away.

            regards, tom lane



pgsql-hackers by date:

Previous
From: Andres Freund
Date:
Subject: Re: run pgindent on a regular basis / scripted manner
Next
From: Peter Geoghegan
Date:
Subject: Re: run pgindent on a regular basis / scripted manner