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

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Peter Eisentraut <peter(at)eisentraut(dot)org>, Jelte Fennema-Nio <postgres(at)jeltef(dot)nl>, 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-13 10:01:56
Message-ID: 58f59ede-a0ea-4167-b46a-ea36f4c9eb4a@dunslane.net
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


On 2026-03-12 Th 5:10 AM, Peter Eisentraut wrote:
> On 04.03.26 10:18, Jelte Fennema-Nio wrote:
>> On Wed Dec 31, 2025 at 4:48 PM CET, Andrew Dunstan wrote:
>>> I'd kinda like to unify these universes, though. We could import the
>>> pgperltidy logic into pgindent but disable it unless some flag were
>>> given and the correct version of perltidy were present.
>>
>> Attached is an initial patchset that does that, as well as improving
>> pgindent in various other ways. This has removed the make/meson
>> integration and instead made pgindent smarter at finding pg_bsd_indent
>> and perltidy. I believe that with all of these QoL improvements we could
>> enable perltidy in pgindent by default (after doing a full indent run).
>>
>> I want to call pretty much all of this code was written by Claude Code
>> (i.e. an AI). I plan to do another review pass over this code soonish.
>> Especially the later commits, which I haven't checked in detail yet.
>> But for now I at least wanted to share the direction of what I've been
>> working on, because I saw that Peter marked himself as reviewer on the
>> commitfest app and I don't think it makes sense for him to look at the
>> previous patchset.
>
> Apparently, this is still work in progress, but here are some comments
> from me.
>
> I'm very interested in the patch "pgindent: Clean up temp files on
> SIGINT", because this is an annoying problem.  But I didn't find any
> documentation about why this is the correct solution.  I didn't find
> anything on the File::Temp man page, for example.  Do you have more
> details?
>
> The patch "pgindent: Use git ls-files to discover files" is also
> interested and pretty straightforward.  I guess we don't really care
> about being able to run this in non-git trees?
>
> The other stuff I don't think I'm really on board with.  In
> particular, I don't like integrating pgperltidy into pgindent. These
> things are in practice run at different times and the underlying tools
> update differently and require different management, so integrating
> them all might lead to various annoyances.
>
> I kind of liked the original idea of a "make format", and then you
> could have subtargets like "make format-c" and "make format-perl" if
> you don't have all the tools.
>
> The parallel pgindent is pretty nice, but I wonder how "use POSIX"
> works on Windows?

POSIX is ok. fork() can be dubious (see `perldoc perlfork`). But we
could disable the parallel stuff on Windows if necessary.

cheers

andrew

--
Andrew Dunstan
EDB: https://www.enterprisedb.com

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Daniel Gustafsson 2026-03-13 10:02:47 Re: Add "format" target to make and ninja to run pgindent and pgperltidy
Previous Message Amit Kapila 2026-03-13 10:00:05 Re: Skipping schema changes in publication