Re: Improve pgindent's formatting named fields in struct literals and varidic functions

From: Chao Li <li(dot)evan(dot)chao(at)gmail(dot)com>
To: Andreas Karlsson <andreas(at)proxel(dot)se>
Cc: Jelte Fennema-Nio <postgres(at)jeltef(dot)nl>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Improve pgindent's formatting named fields in struct literals and varidic functions
Date: 2026-03-31 08:31:37
Message-ID: 1C9E26A3-8C99-4624-8981-7D42E852C274@gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> On Mar 31, 2026, at 16:03, Andreas Karlsson <andreas(at)proxel(dot)se> wrote:
>
> On 3/31/26 9:16 AM, Jelte Fennema-Nio wrote:
>> On Tue, 31 Mar 2026 at 08:30, Andreas Karlsson <andreas(at)proxel(dot)se> wrote:
>>> Rebased it again.
>> I agree this looks better. So seems like a reasonable improvement.
>
> Thanks for taking a look!
>
> But noticed now that the tests were broken so here is a new version where they pass and where I also added a new test case for struct literals with named fields.
>
> Andreas
> <v4-0001-Make-pgindent-add-a-space-between-comma-and-perio.patch><v4-0002-Run-pgindent-add-a-space-between-comma-and-period.patch>

I applied the patch and played with it a little bit. I didn’t find any problem. The patch idea looks reasonable to me, after a comma, dot is no longer acting as structure member access, so inserting a white space feels good.

I saw a couple of typos in the commit message:

varidic -> variadic
treaing -> treating

Overall, looks good to me.

Best regards,
--
Chao Li (Evan)
HighGo Software Co., Ltd.
https://www.highgo.com/

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2026-03-31 08:33:36 Re: Make copyObject work in C++
Previous Message Andreas Karlsson 2026-03-31 08:03:59 Re: Improve pgindent's formatting named fields in struct literals and varidic functions