Re: Add "format" target to make and ninja to run pgindent and pgperltidy - Mailing list pgsql-hackers

From Peter Eisentraut
Subject Re: Add "format" target to make and ninja to run pgindent and pgperltidy
Date
Msg-id 4645a523-8774-45d8-894e-9c83d5954155@eisentraut.org
Whole thread Raw
In response to Re: Add "format" target to make and ninja to run pgindent and pgperltidy  ("Jelte Fennema-Nio" <postgres@jeltef.nl>)
Responses Re: Add "format" target to make and ninja to run pgindent and pgperltidy
List 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.




pgsql-hackers by date:

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