Re: pg_createsubscriber TAP test wrapping makes command options hard to read.

From: Peter Smith <smithpb2250(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: pg_createsubscriber TAP test wrapping makes command options hard to read.
Date: 2024-12-12 02:32:19
Message-ID: CAHut+Ps6Q+i_3xS6H7ybw3-hx9+2QOuneTJwHArxqxFnKX5+4g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Dec 12, 2024 at 12:41 PM Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>
> Peter Smith <smithpb2250(at)gmail(dot)com> writes:
> > While reviewing a patch for another pg_createsubscriber thread I found
> > that multiple TAP tests have a terrible wrapping where the command
> > options and their associated oparg are separated on different lines
> > instead of paired together nicely. This makes it unnecessarily
> > difficult to see what the test is doing.
>
> I think that is mostly the fault of pgperltidy. We did change
> the options we use with it awhile back, so maybe now it will honor
> your manual changes to its line-wrapping choices. But I wouldn't
> bet on that. Did you check what happens if you run the modified
> code through pgperltidy?
>
> (If the answer is bad, we could look into making further changes so
> that pgperltidy won't override these decisions. But there's no point
> in manually patching this if it'll just get undone.)
>

Thanks for your suggestion. As you probably suspected, the answer is bad.

I ran pgperltidy on the "fixed" file:
[postgres(at)CentOS7-x64 oss_postgres_misc]$
src/tools/pgindent/pgperltidy
src/bin/pg_basebackup/t/040_pg_createsubscriber.pl

This reverted it to how it currently looks on master.

The strange thing is there are other commands in that file very
similar to the ones I had changed but those already looked good, yet
they remained unaffected by the pgperltidy. Why?

======
Kind Regards,
Peter Smith.
Fujitsu Australia

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Hayato Kuroda (Fujitsu) 2024-12-12 02:43:50 RE: Adding a '--two-phase' option to 'pg_createsubscriber' utility.
Previous Message John Naylor 2024-12-12 02:30:59 Re: CRC32C Parallel Computation Optimization on ARM