Re: perlcritic and perltidy

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: perlcritic and perltidy
Дата
Msg-id 11451.1525624446@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: perlcritic and perltidy  (Andrew Dunstan <andrew.dunstan@2ndquadrant.com>)
Ответы Re: perlcritic and perltidy  (Stephen Frost <sfrost@snowman.net>)
Список pgsql-hackers
Andrew Dunstan <andrew.dunstan@2ndquadrant.com> writes:
> On 05/06/2018 11:53 AM, Tom Lane wrote:
>> What sort of changes do we get if we remove those two flags as you prefer?
>> It'd help to see some examples.

> Essentially it adds some vertical whitespace to structures so that the
> enclosing braces etc appear on their own lines. A very typical change
> looks like this:

>     -         { code      => $code,
>     +         {
>     +           code      => $code,
>                 ucs       => $ucs,
>                 comment   => $rest,
>                 direction => $direction,
>                 f         => $in_file,
>     -           l         => $. };
>     +           l         => $.
>     +         };

Hm.  I have no strong opinion about whether this looks better or not;
people who write more Perl than I do ought to weigh in.

However, I do want to note that we've chosen the shorter style for
the catalog .dat files, and that's enforced by reformat_dat_file.pl.
I'd be against changing that decision, because one of the goals for
the .dat file format was to minimize the risk of patches applying in
the wrong place.  Near-content-free lines containing just "{" or "},"
would increase that risk by reducing the uniqueness of patch context
lines.

It's not essential for the .dat files to match the Perl layout we use
elsewhere, of course.  But perhaps consistency is one factor to
consider here.

            regards, tom lane


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

Предыдущее
От: Andrew Dunstan
Дата:
Сообщение: Re: perlcritic and perltidy
Следующее
От: Andrey Borodin
Дата:
Сообщение: Re: [HACKERS] Clock with Adaptive Replacement