pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Andrew Dunstan <andrew@dunslane.net>
Cc: pgsql-hackers@lists.postgresql.org
Subject: Re: run pgindent on a regular basis / scripted manner
Date: Sat, 21 Jan 2023 11:10:08 -0500
Message-ID: <912484.1674317408@sss.pgh.pa.us> (raw)
In-Reply-To: <a55329d4-84b5-6615-2c66-98856c6b94a7@dunslane.net>
References: <CABUevExkB=+FX5Ht2sU6Tmk1fF0h8LqugW5camQ-r00ftPZoSg@mail.gmail.com>
	<20200814202651.GA31108@alvherre.pgsql>
	<CABUevEwGPPaUtObrDywO+vhpFDTJXO+-aeWJd7D46uXTE2sQpA@mail.gmail.com>
	<CAGECzQQs+hz4uQSmD_8oRLr74GtxpE0iXuYE85+RHAzvkF_yvQ@mail.gmail.com>
	<531251.1674234545@sss.pgh.pa.us>
	<20230120175806.iogdcra2xpmmh5de@awork3.anarazel.de>
	<538672.1674238787@sss.pgh.pa.us>
	<c9c9fa6d-6de6-48c2-4f8b-0fbeef026439@dunslane.net>
	<17455b0f-0161-9aa9-b6dd-1279e947b8f4@dunslane.net>
	<3cdb09f1-6375-4198-e8c1-e33ca4c96304@dunslane.net>
	<a55329d4-84b5-6615-2c66-98856c6b94a7@dunslane.net>

Andrew Dunstan <andrew@dunslane.net> writes:
>>> I think we could do better with some automation tooling for committers
>>> here. One low-risk and simple change would be to provide a
>>> non-destructive mode for pgindent that would show you the changes if any
>>> it would make. That could be worked into a git pre-commit hook that
>>> committers could deploy. I can testify to the usefulness of such hooks -
>>> I have one that while not perfect has saved me on at least two occasions
>>> from forgetting to bump the catalog version.

That sounds like a good idea from here.  I do not think we want a
mandatory commit filter, but if individual committers care to work
this into their process in some optional way, great!  I can think
of ways I'd use it during patch development, too.

(One reason not to want a mandatory filter is that you might wish
to apply pgindent as a separate commit, so that you can then
put that commit into .git-blame-ignore-revs.  This could be handy
for example when a patch needs to change the nesting level of a lot
of pre-existing code, without making changes in it otherwise.)

>> This time with patch.

> ... with typo fixed.

Looks reasonable, but you should also update
src/tools/pgindent/pgindent.man, which AFAICT is our only
documentation for pgindent switches.  (Is it time for a
--help option in pgindent?)

			regards, tom lane





view thread (308+ messages)  latest in thread

Message-ID: <912484.1674317408@sss.pgh.pa.us>
Permalink:  ../912484.1674317408@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/912484.1674317408@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: tgl@sss.pgh.pa.us, andrew@dunslane.net, pgsql-hackers@lists.postgresql.org
  Subject: Re: run pgindent on a regular basis / scripted manner
  In-Reply-To: <912484.1674317408@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox