Re: Add --check option to pgindent

From: "Tristan Partin" <tristan(at)neon(dot)tech>
To: "Andrew Dunstan" <andrew(at)dunslane(dot)net>, "Alvaro Herrera" <alvherre(at)alvh(dot)no-ip(dot)org>, "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "Euler Taveira" <euler(at)eulerto(dot)com>, "Michael Banck" <mbanck(at)gmx(dot)net>, "Daniel Gustafsson" <daniel(at)yesql(dot)se>, "pgsql-hackers" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Add --check option to pgindent
Date: 2023-12-14 16:53:39
Message-ID: CXO7OZEZ53RE.1Q4SXU4WJ25RN@neon.tech
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed Dec 13, 2023 at 2:46 PM CST, Andrew Dunstan wrote:
>
> On 2023-12-12 Tu 10:30, Alvaro Herrera wrote:
> > On 2023-Dec-12, Tom Lane wrote:
> >
> >> "Euler Taveira" <euler(at)eulerto(dot)com> writes:
> >>> When you add exceptions, it starts to complicate the UI.
> >> Indeed. It seems like --silent-diff was poorly defined and poorly
> >> named, and we need to rethink that option along the way to adding
> >> this behavior. The idea that --show-diff and --silent-diff can
> >> be used together is just inherently confusing, because they sound
> >> like opposites
> > Maybe it's enough to rename --silent-diff to --check. You can do
> > "--show-diff --check" and get both the error and the diff printed; or
> > just "--check" and it'll throw an error without further ado; or
> > "--show-diff" and it will both apply the diff and print it.
> >
>
> That seems reasonable. These features were fairly substantially debated
> when we put them in, but I'm fine with some tweaking. But note:
> --show-diff doesn't apply the diff, it's intentionally non-destructive.

Here is a new patch:

- Renames --silent-diff to --check
- Renames --show-diff to --diff
- Allows one to use --check and --diff in the same command

I am not tied to the second patch if people like --show-diff better than
--diff.

Weirdly enough, my email client doesn't show this as part of the
original thread, but I will respond here anyway.

--
Tristan Partin
Neon (https://neon.tech)

Attachment Content-Type Size
v2-0001-Rename-silent-diff-to-check-in-pgindent.patch text/x-patch 2.0 KB
v2-0002-Rename-show-diff-to-diff-in-pgindent.patch text/x-patch 2.4 KB
v2-0003-Allow-check-and-diff-to-passed-in-the-same-pginde.patch text/x-patch 1.4 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Euler Taveira 2023-12-14 19:05:44 Re: logical decoding and replication of sequences, take 2
Previous Message Jelte Fennema-Nio 2023-12-14 15:54:57 Re: Add new for_each macros for iterating over a List that do not require ListCell pointer