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

From: Jelte Fennema-Nio <[email-masked]>
Date: Thu, 1 Jan 2026 14:06:29 +0100

On Wed, 31 Dec 2025 at 19:37, Tom Lane <[email-masked]> wrote:
> As an affected committer, I want to push back against having such
> a requirement, because I don't think it is reasonable to require
> everybody to have precisely version XYZ of perltidy installed.
> If that's not the version provided by their platform-of-choice,
> it's an annoying hurdle.

That's why I tried to make that hurdle as small as possible. All
that's needed with the current patchset is:

wget https://cpan.metacpan.org/authors/id/S/SH/SHANCOCK/Perl-Tidy-20230309.tar.gz
cpanm -l $HOME/perltidy-20230309 Perl-Tidy-20230309.tar.gz
meson setup build -DPERLTIDY=$HOME/perltidy-20230309/bin/perltidy --reconfigure

> As a comparison point, we did not start requiring pgindent cleanliness
> until we imported bsdindent into our tree, so as not to have an
> external dependency for that.  (But I can't see vendoring perltidy,
> even if there weren't license issues involved.)

I agree vendoring perltidy seems like a bad idea. Given you think
those 3 commands above are still an annoying hurdle, I'm curious what
you think would be a small enough hurdle to not be annoying? A few
options I can see:

1. src/tools/indent/get_perltidy /your/path/of/choice (and then give
this path to configure/meson)
2. make/ninja get-perltidy (downloads + installs to a known directory
inside the build dir)
3. make/ninja format (which then downloads perltidy if it's not yet available)

> Here, the hurdle would be erected for no
> reason stronger than neatnik-ism, and IMO that's not a good enough
> reason to put yet another burden on committers.

To me, the goal of autoformatting is the exact opposite of
neatnik-ism. It means devs don't have to worry about styling their
code nicely because the tool will fix it. So no mental capacity is
spent considering arbitrary styling decisions like where to put
newlines etc.

---

From: Dagfinn Ilmari Mannsåker <[email-masked]>
Date: Mon, 05 Jan 2026 18:11:42 +0000

> cpanm -l $HOME/perltidy-20230309 Perl-Tidy-20230309.tar.gz

You can ask cpanm to install a specific version without having to
download the tarball manually or knowing who made the release and which
archive format they used:

   cpanm -l $HOME/perltidy-20230309 Perl::Tidy@20230309

- ilmari