pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andrew Dunstan <andrew@dunslane.net>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Add non-destructive modes to pgindent
Date: Mon, 23 Jan 2023 12:11:09 +0000
Message-ID: <E1pJvfJ-00543s-LJ@gemulon.postgresql.org> (raw)

Add non-destructive modes to pgindent

This adds two modes of running pgindent, neither of which results in
any changes being made to the source code. The --show-diff option shows
what changes would have been made, and the --silent-diff option just
exits with a status of 2 if any changes would be made. The second of
these is intended for scripting use in places such as git hooks.

Along the way some code cleanup is done, and a --help option is also
added.

Reviewed by Tom Lane

Discussion: https://postgr.es/m/c9c9fa6d-6de6-48c2-4f8b-0fbeef026439@dunslane.net

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/b90f0b57474eac3980be8146f2e45f73a05c994f

Modified Files
--------------
src/tools/pgindent/pgindent     | 98 ++++++++++++++++++++++++++++++-----------
src/tools/pgindent/pgindent.man |  7 +++
2 files changed, 79 insertions(+), 26 deletions(-)



Message-ID: <E1pJvfJ-00543s-LJ@gemulon.postgresql.org>
Permalink:  ../E1pJvfJ-00543s-LJ@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1pJvfJ-00543s-LJ@gemulon.postgresql.org

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: andrew@dunslane.net
  Subject: Re: pgsql: Add non-destructive modes to pgindent
  In-Reply-To: <E1pJvfJ-00543s-LJ@gemulon.postgresql.org>
  References: <E1pJvfJ-00543s-LJ@gemulon.postgresql.org>

* 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