Re: Add --check option to pgindent - Mailing list pgsql-hackers

From Jelte Fennema-Nio
Subject Re: Add --check option to pgindent
Date
Msg-id CAGECzQS0zOsf3+NTxZPpBaBm7vivJwfZ=n=Qq0x62mRhFq52vQ@mail.gmail.com
Whole thread Raw
In response to Re: Add --check option to pgindent  (Daniel Gustafsson <daniel@yesql.se>)
Responses Re: Add --check option to pgindent
Re: Add --check option to pgindent
Re: Add --check option to pgindent
List pgsql-hackers
On Mon, 18 Dec 2023 at 13:42, Daniel Gustafsson <daniel@yesql.se> wrote:
> I think this is pretty much ready to go, the attached v4 squashes the changes
> and fixes the man-page which also needed an update.  The referenced Wiki page
> will need an edit or two after this goes in, but that's easy enough.

One thing I'm wondering: When both --check and --diff are passed,
should pgindent still early exit with 2 on the first incorrectly
formatted file? Or should it show diffs for all failing files? I'm
leaning towards the latter making more sense.

Related (but not required for this patch): For my pre-commit hook I
would very much like it if there was an option to have pgindent write
the changes to disk, but still exit non-zero, e.g. a --write flag that
could be combined with --check just like --diff and --check can be
combined with this patch. Currently my pre-commit hook need two
separate calls to pgindent to both abort the commit and write the
required changes to disk.



pgsql-hackers by date:

Previous
From: Matthias van de Meent
Date:
Subject: Re: Add --check option to pgindent
Next
From: Jelte Fennema-Nio
Date:
Subject: Re: Add --check option to pgindent