]> git.ipfire.org Git - thirdparty/postgresql.git/commit
pgindent: improve formatting of multiline comments.
authorTom Lane <tgl@sss.pgh.pa.us>
Wed, 13 May 2026 14:21:54 +0000 (10:21 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Wed, 13 May 2026 14:21:54 +0000 (10:21 -0400)
commit60f9467c38348e06ad96815d4394651dd02a0389
treec581b999204acf4b5af79b2c527867c3a4168078
parentb518ba4affed8d3a47944d769d33b7814d88ddb2
pgindent: improve formatting of multiline comments.

Enforce this standard formatting of multiline comments that start
in column 1:

/*
 * line 1
 * line 2
 */

Unlike indented comments, we don't reconsider line breaks, except
for forcing the initial /* and trailing */ onto their own lines.
We do make each line start with " *", with some whitespace following.

We preserve pgindent's existing behavior of not touching comments
that begin with /**... or /*-...  Also, if the first line looks like
/* === or /* ---, we don't split that line; similarly for the last
line.

The vast majority of multiline comments in our tree already look
like this, but this change will clean up some stragglers.

Author: Aleksander Alekseev <aleksander@tigerdata.com>
Reported-by: Michael Paquier <michael@paquier.xyz>
Reviewed-by: Arseniy Mukhin <arseniy.mukhin.dev@gmail.com>
Reviewed-by: Nathan Bossart <nathandbossart@gmail.com>
Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us>
Discussion: https://postgr.es/m/CAJ7c6TPQ0kkHQG-AqeAJ3PV_YtmDzcc7s%2B_V4%3Dt%2BxgSnZm1cFw%40mail.gmail.com
Discussion: https://postgr.es/m/EB0141C5-ACC2-4F0B-85EA-0E3AFBCE322F@umbc.edu
src/tools/pgindent/pgindent