Re: pgindent run

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: David Rowley <dgrowleyml(at)gmail(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: pgindent run
Date: 2021-06-28 13:25:34
Message-ID: 01d265a4-a85f-cf31-83cc-cc5ffb84bf17@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


On 6/28/21 8:52 AM, David Rowley wrote:
> On Tue, 29 Jun 2021 at 00:29, Andrew Dunstan <andrew(at)dunslane(dot)net> wrote:
>> Here's the diff from a pgindent run.
> --- a/src/backend/commands/policy.c
> +++ b/src/backend/commands/policy.c
> @@ -587,65 +587,65 @@ RemoveRoleFromObjectPolicy(Oid roleid, Oid
> classid, Oid policy_id)
> /* If any roles remain, update the policy entry. */
> if (num_roles > 0)
> {
> - /* This is the array for the new tuple */
> - role_ids = construct_array(role_oids, num_roles, OIDOID,
> - sizeof(Oid), true, TYPALIGN_INT);
> + /* This is the array for the new tuple */
> + role_ids = construct_array(role_oids, num_roles, OIDOID,
> + sizeof(Oid), true, TYPALIGN_INT);
>
> I wasn't too sure about the status of this one. Michael did mention it
> in [1], but Tom mentioned that was on purpose to ease backpatching.
> I'm not too clear on if Tom intended it should stay unindented until
> "rewriting that whole function in a little bit".
>
> David
>
> [1] https://www.postgresql.org/message-id/YM0puvBnbBIZxJt2@paquier.xyz

I'll let Tom speak for himself, but I somewhat doubt he meant the code
to stay badly indented for more than a short period of time.
Unfortunately, while pgindent has code that allows protecting comments
from being formatted, it doesn't have a similar mechanism for code AFAICT.

cheers

andrew

--
Andrew Dunstan
EDB: https://www.enterprisedb.com

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Laurenz Albe 2021-06-28 13:39:44 Re: Deadlock risk while inserting directly into partition?
Previous Message Daniel Gustafsson 2021-06-28 13:06:37 Unbounded %s in sscanf