[PATCH] pg_bsd_indent: improve formatting of multiline comments

From: Aleksander Alekseev <aleksander(at)timescale(dot)com>
To: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Cc: Michael Paquier <michael(at)paquier(dot)xyz>
Subject: [PATCH] pg_bsd_indent: improve formatting of multiline comments
Date: 2025-06-19 14:51:36
Message-ID: CAJ7c6TPQ0kkHQG-AqeAJ3PV_YtmDzcc7s+_V4=t+xgSnZm1cFw@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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

Attachment Content-Type Size
v1-0001-pg_bsd_indent-improve-formatting-of-multiline-com.patch application/octet-stream 2.1 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Daniel Gustafsson 2025-06-19 15:05:25 Re: Non-reproducible AIO failure
Previous Message Peter Eisentraut 2025-06-19 14:51:02 Re: Add CASEFOLD() function.