Re: [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: Arseniy Mukhin <arseniy.mukhin.dev@gmail.com>, Michael Paquier <michael@paquier.xyz>
Date: 2025-06-20T13:44:08Z
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 Arseniy,

> I tried it with the whole project and almost always it works great.
> But I noticed two cases where it works probably not as expected:
>
> 1) comments which don't have a star on each line. For example:
> file 'cube.c'
>
> before:
> /* make up a metric in which one box will be 'lower' than the other
>    -- this can be useful for sorting and to determine uniqueness */
>
> after:
> /*
>  * make up a metric in which one box will be 'lower' than the other
>    -- this can be useful for sorting and to determine uniqueness */
>
> 2) comments where closing */ is on the last comment line. For example:
> file 'crypt-blowfish.c'
>
> before:
> /* This has to be bug-compatible with the original implementation, so
>  * only encode 23 of the 24 bytes. :-) */
>
> after:
> /*
>  * This has to be bug-compatible with the original implementation, so
>  * only encode 23 of the 24 bytes. :-) */

Thanks for the review. You are right, these comments shouldn't be affected.

It's going to be simpler to modify pgindent then. PFA the updated patch.

-- 
Best regards,
Aleksander Alekseev