pgsql: Add non-destructive modes to pgindent

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Add non-destructive modes to pgindent
Date: 2023-01-23 12:11:09
Message-ID: E1pJvfJ-00543s-LJ@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

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(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Andrew Dunstan 2023-01-23 13:43:01 pgsql: Restructure Ldap TAP test
Previous Message Dean Rasheed 2023-01-23 12:00:25 pgsql: Optimise numeric division for 3 and 4 base-NBASE digit divisors.