public inbox for [email protected]
help / color / mirror / Atom feedFrom: Chao Li <[email protected]>
To: Nathan Bossart <[email protected]>
Cc: Tom Lane <[email protected]>
Cc: Rahila Syed <[email protected]>
Cc: Robert Haas <[email protected]>
Cc: PostgreSQL Hackers <[email protected]>
Subject: Re: pgindent versus struct members and typedefs
Date: Wed, 6 May 2026 09:29:36 +0800
Message-ID: <[email protected]> (raw)
In-Reply-To: <afplW8DvRONDc1yl@nathan>
References: <aS9hkwnkWf3dZIA_@nathan>
<[email protected]>
<[email protected]>
<afplW8DvRONDc1yl@nathan>
> On May 6, 2026, at 05:47, Nathan Bossart <[email protected]> wrote:
>
> On Tue, Dec 02, 2025 at 05:51:15PM -0500, Tom Lane wrote:
>> Chao Li <[email protected]> writes:
>>> On Dec 3, 2025, at 06:00, Nathan Bossart <[email protected]> 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.
>
> For fun, I spent some time with an AI tool to develop the attached fix for
> this problem. The explanation seems reasonable to me, although I am by no
> means a pgindent expert. When I looked at this in December, I did find
> this similar commit from upstream [0], but I failed to make the connection
> with last_u_d. 0002 is the result of a pgindent run after applying 0001.
> You'll notice that it fixes the exact set of cases I found with grep
> upthread.
>
> [0] https://github.com/pstef/freebsd_indent/commit/afa2239
>
> --
> nathan
> <v1-0001-pgindent-Fix-spacing-after-when-member-name-match.patch><v1-0002-run-pgindent.patch>
From 0002, the fix looks good. I tried to run the patched pgindent against all .c and .h files under src/ and contrib/, the result is exactly the same as 0002.
So, maybe worthy pushing before Tom running the annual pgindent.
Best regards,
--
Chao Li (Evan)
HighGo Software Co., Ltd.
https://www.highgo.com/
view thread (22+ messages) latest in thread
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: [email protected]
Cc: [email protected], [email protected], [email protected], [email protected], [email protected], [email protected]
Subject: Re: pgindent versus struct members and typedefs
In-Reply-To: <[email protected]>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox