Re: pgindent to ignore build directories

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Peter Eisentraut <peter(at)eisentraut(dot)org>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: pgindent to ignore build directories
Date: 2026-09-24 14:29:05
Message-ID: 1668758.1790260145@sss.pgh.pa.us
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Peter Eisentraut <peter(at)eisentraut(dot)org> writes:
> A problem I'm having is that if I'm having a build directory inside the
> source tree
> meson setup build
> (as is documented) and then run pgindent
> src/tools/pgindent/pgindent .
> it descends into the build directory and then chokes on various files in
> there.

Right, we should handle that.

> A subproblem is that if pgindent fails on many files, it doesn't clean
> up after itself but leaves many pgsrc*.BAK files lying around. The
> first patch fixes that.

I object to this patch. src/tools/pgindent/README documents that
the presence of those files is useful for detecting where pgindent
failed. Without them there's not an easy signal.

> Then, my first idea was to add an option to pgindent to exclude
> directories from being processed. Like
> src/tools/pgindent/pgindent . --exclude-dir=build
> The second patch implements that.

That seems a bit tedious.

> But then I had the idea that we could recognize build directories
> automatically by checking what files they contain. The third patch
> implements that. That way, my initial pgindent invocation above works
> out of the box and I don't have to remember to enumerate the build
> directories on the command line.

+1 for this one. I could do without 0002, for myself; what use would
it have once the automatic logic exists?

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Nathan Bossart 2026-09-24 14:33:13 Re: Logical Implication
Previous Message Manu 2026-09-24 14:28:54 Re: Temp schema drop leaves an inconsistent state behind