Re: run pgindent on a regular basis / scripted manner

From: Justin Pryzby <pryzby(at)telsasoft(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Andrew Dunstan <andrew(at)dunslane(dot)net>, Jelte Fennema <postgres(at)jeltef(dot)nl>, shiy(dot)fnst(at)fujitsu(dot)com, Robert Haas <robertmhaas(at)gmail(dot)com>, Andres Freund <andres(at)anarazel(dot)de>, Noah Misch <noah(at)leadboat(dot)com>, Peter Geoghegan <pg(at)bowt(dot)ie>, Bruce Momjian <bruce(at)momjian(dot)us>, Magnus Hagander <magnus(at)hagander(dot)net>, Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, Stephen Frost <sfrost(at)snowman(dot)net>, Jesse Zhang <sbjesse(at)gmail(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: run pgindent on a regular basis / scripted manner
Date: 2023-02-12 20:59:36
Message-ID: 20230212205936.GV1653@telsasoft.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sun, Feb 12, 2023 at 11:24:14AM -0500, Tom Lane wrote:
> Andrew Dunstan <andrew(at)dunslane(dot)net> writes:
> > ... then you could do
> >     pgindent `git dirty`
> > The only danger would be if there were no dirty files. Maybe we need a
> > switch to inhibit using the current directory if there are no command
> > line files.
>
> It seems like "indent the whole tree" is about to become a minority
> use-case. Maybe instead of continuing to privilege that case, we
> should say that it's invoked by some new switch like --all-files,
> and without that only the stuff identified by command-line arguments
> gets processed.

It seems like if pgindent knows about git, it ought to process only
tracked files. Then, it wouldn't need to manually exclude generated
files, and it wouldn't process vpath builds and who-knows-what else it
finds in CWD.

At least --commit doesn't seem to work when run outside of the root
source dir.

--
Justin

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2023-02-12 21:13:35 Re: run pgindent on a regular basis / scripted manner
Previous Message Andrew Dunstan 2023-02-12 20:41:56 Re: run pgindent on a regular basis / scripted manner