Re: pgindent versus struct members and typedefs - Mailing list pgsql-hackers

From Tom Lane
Subject Re: pgindent versus struct members and typedefs
Date
Msg-id 509793.1764715875@sss.pgh.pa.us
Whole thread Raw
In response to Re: pgindent versus struct members and typedefs  (Chao Li <li.evan.chao@gmail.com>)
Responses Re: pgindent versus struct members and typedefs
List pgsql-hackers
Chao Li <li.evan.chao@gmail.com> writes:
> On Dec 3, 2025, at 06:00, Nathan Bossart <nathandbossart@gmail.com> wrote:
>> I tried to fix pgindent for a few, but the code is basically impenetrable.
>> I didn't find any fixes upstream [0], either.  As noted above, we could
>> also fix it by avoiding the naming conflicts.  However, I can't imagine
>> that's worth the churn, and I've already spent way too much time on this,
>> so IMHO the best thing to do here is nothing.

> I think that’s fine.

Agreed, not worth the trouble to fool with.

> Actually I see the other problem with pgindent, where if a “else” clause contains a multiple-line comment and a
singlestatement without braces, for example: 
> ...
> I tried to fix but failed. For that problem, a solution is to add braces to the “else” clause.

In this case, I think pgindent is indirectly enforcing good style.
I do not like omitting braces around anything that's more than one
line; readers have to pay close attention to whether the code is
doing what it was intended to.

            regards, tom lane



pgsql-hackers by date:

Previous
From: Chao Li
Date:
Subject: Re: pgindent versus struct members and typedefs
Next
From: Chao Li
Date:
Subject: Re: pgindent versus struct members and typedefs