Re: Add "format" target to make and ninja to run pgindent and pgperltidy

From: Peter Eisentraut <peter(at)eisentraut(dot)org>
To: Jelte Fennema-Nio <postgres(at)jeltef(dot)nl>, Andrew Dunstan <andrew(at)dunslane(dot)net>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Ashutosh Bapat <ashutosh(dot)bapat(dot)oss(at)gmail(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Daniel Gustafsson <daniel(at)yesql(dot)se>
Subject: Re: Add "format" target to make and ninja to run pgindent and pgperltidy
Date: 2026-03-27 13:32:27
Message-ID: 4645a523-8774-45d8-894e-9c83d5954155@eisentraut.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 13.03.26 09:29, Jelte Fennema-Nio wrote:
> On Thu Mar 12, 2026 at 10:10 AM CET, Peter Eisentraut wrote:
>> Apparently, this is still work in progress, but here are some comments
>> from me.
>
> Thanks for the review. I went over the code in detail now myself, and
> haven't found anything hugehely weird (although I did a bit of cleanup
> and additional comments). As said before I'm definetly not a Perl expert
> though, so I might have missed some wrong details. But all the logic at
> least
> seems sound.
>
> I also reorderd the commits to have the perltidy integration as the last
> ones, and the general pgindent QoL imorovements first.

v3-0001-pgindent-Clean-up-temp-files-created-by-File-Temp.patch
v3-0002-pgindent-Always-clean-up-.BAK-files-from-pg_bsd_i.patch

I have committed these two.

v3-0003-pgindent-Use-git-ls-files-to-discover-files.patch

This looks structurally correct, but I wonder whether this:

my @git_files = `git ls-files -- @dirs`;

could be written in a way that is more robust against funny file names.
(pgindent is also used against trees that are not stock PostgreSQL.)

v3-0004-pgindent-Default-to-indenting-the-current-directo.patch

Note that other tools also share this behavior with pgindent:

src/tools/pgindent/pgperltidy
src/tools/perlcheck/pgperlcritic
src/tools/perlcheck/pgperlsyncheck

If we change one, we should change all.

It might be that the current behavior is intentional for some nonobvious
reason, not sure.

v3-0005-pgindent-Allow-parallel-pgindent-runs.patch
v3-0006-pgindent-Try-to-find-pg_bsd_indent-binary-in-comm.patch
v3-0007-pgindent-Integrate-pgperltidy-functionality-into-.patch
v3-0008-pgindent-Add-easy-way-of-getting-perltidy.patch

Still need to check these in more detail. They will probably carry over
into PG20.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Pavel Borisov 2026-03-27 13:45:09 Re: Inherit regression outputs rows in alternative ordering when run on other table AM than heap
Previous Message Bertrand Drouvot 2026-03-27 13:23:14 Re: Enable -Wstrict-prototypes and -Wold-style-definition by default