Re: Add pgindent test to check if codebase is correctly formatted

From: "Tristan Partin" <tristan(at)neon(dot)tech>
To: "Bruce Momjian" <bruce(at)momjian(dot)us>
Cc: "pgsql-hackers" <pgsql-hackers(at)postgresql(dot)org>, "Jelte Fennema-Nio" <postgres(at)jeltef(dot)nl>
Subject: Re: Add pgindent test to check if codebase is correctly formatted
Date: 2024-01-17 01:32:47
Message-ID: CYGLEFXQWRH4.Y3NP0SLR2UI3@neon.tech
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue Jan 16, 2024 at 7:27 PM CST, Bruce Momjian wrote:
> On Tue, Jan 16, 2024 at 07:22:23PM -0600, Tristan Partin wrote:
> > I think a good solution would be to distribute pgindent and pg_bsd_indent.
> > At Neon, we are trying to format our extension code using pgindent. I am
> > sure there are other extension authors out there too that format using
> > pgindent. Distributing pg_bsd_indent and pgindent in the postgresql-devel
> > package would be a great help to those of us that pgindent out of tree code.
> > It would also have the added benefit of adding the tools to $PREFIX/bin,
> > which would make the test that I added not need a hack to get the
> > pg_bsd_indent executable.
>
> So your point is that pg_bsd_indent and pgindent are in the source tree,
> but not in any package distribution? Isn't that a packager decision?

It requires changes to at least the Meson build files. pg_bsd_indent is
not marked for installation currently. There is a TODO there. pgindent
has no install_data() for instance. pg_bsd_indent seemingly gets
installed somewhere in autotools given the contents of its Makefile, but
I didn't see anything in my install tree afterward.

Sure RPM/DEB packagers can solve this issue downstream, but that doesn't
help those of that run "meson install" or "make install" upstream.
Packagers are probably more likely to package the tools if they are
marked for installation by upstream too.

Hope this helps to better explain what changes would be required within
the Postgres source tree.

--
Tristan Partin
Neon (https://neon.tech)

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2024-01-17 01:35:13 Re: Add pgindent test to check if codebase is correctly formatted
Previous Message Bruce Momjian 2024-01-17 01:27:40 Re: Add pgindent test to check if codebase is correctly formatted