Re: pgindent vs variable declaration across multiple lines

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Andres Freund <andres(at)anarazel(dot)de>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: pgindent vs variable declaration across multiple lines
Date: 2023-01-20 01:43:44
Message-ID: 337200.1674179024@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Andres Freund <andres(at)anarazel(dot)de> writes:
> There's a few places in the code that try to format a variable definition like this

> ReorderBufferChange *next_change =
> dlist_container(ReorderBufferChange, node, next);

> but pgindent turns that into

> ReorderBufferChange *next_change =
> dlist_container(ReorderBufferChange, node, next);

Yeah, that's bugged me too. I suspect that the triggering factor is
use of a typedef name within the assigned expression, but I've not
tried to run it to ground.

> I assume we'd again have to dive into pg_bsd_indent's code to fix it :(

Yeah :-(. That's enough of a rat's nest that I've not really wanted to.
But I'd support applying such a fix if someone can figure it out.

> And even if we were to figure out how, would it be worth the
> reindent-all-branches pain? I'd say yes, but...

What reindent-all-branches pain? We haven't done an all-branches
reindent in the past, even for pgindent fixes that touched far more
code than this would (assuming that the proposed fix doesn't have
other side-effects).

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2023-01-20 01:46:28 Re: Non-superuser subscription owners
Previous Message Andres Freund 2023-01-20 01:31:37 pgindent vs variable declaration across multiple lines