[PATCH] pg_bsd_indent: improve formatting of multiline comments

Aleksander Alekseev <aleksander@timescale.com>

From: Aleksander Alekseev <aleksander@timescale.com>
To: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Cc: Michael Paquier <michael@paquier.xyz>
Date: 2025-06-19T14:51:36Z
Lists: pgsql-hackers

Commits

Same data as JSON: GET /api/v1/messages/:b64id/commits the thread's linked commits as JSON, with link sources. API reference →
  1. pgindent: improve formatting of multiline comments.

  2. Adjust style of some debugging macros.

  3. Fix a couple of comments.

  4. Add IGNORE NULLS/RESPECT NULLS option to Window functions.

  5. Split WaitEventSet functions to separate source file

Attachments

Hi,

Michael (cc:'ed) pointed out [1] that pg_bsd_indent could do a
slightly better job when it comes to formatting multiline comments. I
prepared a patch that fixes this.

How to test it:

```
ninja -C build
cp build/src/tools/pg_bsd_indent/pg_bsd_indent ~/bin/pg_bsd_indent
cp src/tools/pgindent/pgindent ~/bin/pgindent
pgindent src/backend/utils/adt/varlena.c
git diff
```

Expected changes:

```
-/* name_text()
+/*
+ * name_text()
  * Converts a Name type to a text type.
  */
```

Everything else should work as before.

Thoughts and feedback are most welcomed.

[1]: https://postgr.es/m/CAJ7c6TN7ppSmZMPejvKZreOs%3D%2BkJEhrGQNuVpmTjj9W-%3DMjgCg%40mail.gmail.com

-- 
Best regards,
Aleksander Alekseev