Re: Add --check option to pgindent

Поиск
Список
Период
Сортировка
От Jelte Fennema-Nio
Тема Re: Add --check option to pgindent
Дата
Msg-id CAGECzQRAyCkzM=g9Sv149kXqfL_q4t7WdZ4wb_OizmUYhVrRyg@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Add --check option to pgindent  ("Tristan Partin" <tristan@neon.tech>)
Ответы Re: Add --check option to pgindent  ("Tristan Partin" <tristan@neon.tech>)
Список pgsql-hackers
This part of the first patch seems incorrect, i.e. same condition in
the if as elsif

-       if ($silent_diff)
+       if ($check)
+       {
+           print show_diff($source, $source_filename);
+           exit 2;
+       }
+       elsif ($check)
        {
            exit 2;
        }

On Thu, 14 Dec 2023 at 17:54, Tristan Partin <tristan@neon.tech> wrote:
>
> 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@eulerto.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)



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Andrew Dunstan
Дата:
Сообщение: Re: Clean up find_typedefs and add support for Mac
Следующее
От: Andres Freund
Дата:
Сообщение: Re: [meson] expose buildtype debug/optimization info to pg_config