Re: [PATCH] pg_bsd_indent: improve formatting of multiline comments

From: Nathan Bossart <nathandbossart(at)gmail(dot)com>
To: Aleksander Alekseev <aleksander(at)tigerdata(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Arseniy Mukhin <arseniy(dot)mukhin(dot)dev(at)gmail(dot)com>, Bruce Momjian <bruce(at)momjian(dot)us>, Michael Paquier <michael(at)paquier(dot)xyz>
Subject: Re: [PATCH] pg_bsd_indent: improve formatting of multiline comments
Date: 2025-10-27 14:55:38
Message-ID: aP-H6kSsGOxaB21k@nathan
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Oct 27, 2025 at 03:13:33PM +0300, Aleksander Alekseev wrote:
> OK, here is the corrected patch v5.

Thanks. I had to run pgindent twice before it stopped making changes, but
the results look pretty good to me. However, I still noticed a few
oddities.

--- a/contrib/seg/seg.c
+++ b/contrib/seg/seg.c
@@ -2,9 +2,9 @@
* contrib/seg/seg.c
*
******************************************************************************
- This file contains routines that can be bound to a Postgres backend and
- called by the backend in the process of processing queries. The calling
- format for these routines is dictated by Postgres architecture.
+ * This file contains routines that can be bound to a Postgres backend and
+ * called by the backend in the process of processing queries. The calling
+ * format for these routines is dictated by Postgres architecture.
******************************************************************************/

This one is a little weird, but maybe it's okay... It looks like pgindent
retains the spacing (or lack of spacing) in this situation. It's probably
not worth the complexity to try to make it smarter here.

--- a/src/backend/access/nbtree/nbtsort.c
+++ b/src/backend/access/nbtree/nbtsort.c
@@ -69,7 +69,7 @@
/*
* DISABLE_LEADER_PARTICIPATION disables the leader's participation in
* parallel index builds. This may be useful as a debugging aid.
-#undef DISABLE_LEADER_PARTICIPATION
+ *#undef DISABLE_LEADER_PARTICIPATION
*/

IMHO we should either remove this line or move it out of the comment.
AFAICT we ordinarily don't #undef debugging stuff like this, presumably so
you can change it with compile flags.

In aclcheck.c and analyze.c, The **** and ==== lines are still getting
bumped down to a new line.

-.* This function just encapsulates the framing rules.
+ *.* This function just encapsulates the framing rules.

This looks like a goof in commit 25a30bb. I'll go fix that one separately.

--- a/src/backend/storage/ipc/waiteventset.c
+++ b/src/backend/storage/ipc/waiteventset.c
@@ -2010,7 +2010,7 @@ ResOwnerReleaseWaitEventSet(Datum res)
* NB: be sure to save and restore errno around it. (That's standard practice
* in most signal handlers, of course, but we used to omit it in handlers that
* only set a flag.) XXX
- *
+ * *

This one looks like a goof in commit 393e0d2. It's interesting that
pgindent chooses to add an extra * here, though.

--
nathan

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message shveta malik 2025-10-27 15:08:42 Re: POC: enable logical decoding when wal_level = 'replica' without a server restart
Previous Message Aleksander Alekseev 2025-10-27 14:37:37 Re: Add uuid_to_base32hex() and base32hex_to_uuid() built-in functions