pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Dagfinn Ilmari Mannsåker <ilmari@ilmari.org>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Andrew Dunstan <andrew@dunslane.net>
Cc: Peter Smith <smithpb2250@gmail.com>
Cc: Michael Paquier <michael@paquier.xyz>
Cc: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Subject: Re: pg_createsubscriber TAP test wrapping makes command options hard to read.
Date: Thu, 12 Dec 2024 17:08:01 +0000
Message-ID: <87jzc46d8u.fsf@wibble.ilmari.org> (raw)
In-Reply-To: <651128.1734017715@sss.pgh.pa.us>
References: <CAHut+PvfaUZQR3rEnj-Dcg_6713Wu4yRdd-yZkkC9NVsARht8A@mail.gmail.com>
	<556792.1733967676@sss.pgh.pa.us>
	<CAHut+Ps6Q+i_3xS6H7ybw3-hx9+2QOuneTJwHArxqxFnKX5+4g@mail.gmail.com>
	<564915.1733971586@sss.pgh.pa.us>
	<CAHut+PvFGytgJT+K_e2x+uWKuVYCBR3HNaNtPKYEkO3YxAwZvw@mail.gmail.com>
	<Z1peKSb8roiDNgRj@paquier.xyz>
	<CAHut+PvYsVhF5k-mYHVEFdpijdgkYRtoeWVxdspxio0ePRpkug@mail.gmail.com>
	<87pllx5cqn.fsf@wibble.ilmari.org>
	<87msh159c3.fsf@wibble.ilmari.org>
	<0f5256ec-d63e-4e0f-9b71-750a7a4e5c01@dunslane.net>
	<651128.1734017715@sss.pgh.pa.us>

Tom Lane <tgl@sss.pgh.pa.us> writes:

> Andrew Dunstan <andrew@dunslane.net> writes:
>> On 2024-12-12 Th 8:17 AM, Dagfinn Ilmari Mannsåker wrote:
>>> Here's a more thorough patch, that also applies the fat comma treatment
>>> to other pg_createsubscriber invocations in the same file that don't
>>> currently happen to be mangled by perltidy.  It also adds trailing
>>> commas to the last item in multi-line command arrays, which is common
>>> perl style.
>
>> +1 for this approach.
>
> Indeed, this is much nicer if it's something perltidy knows about.
>
> However, I know we have the same issue in many other places.
> Anyone feel like running through all the TAP scripts?

I can have a go in the next few days.  A quick grep spotted another
workaround in 027_stream_regress.pl: using paretheses around the option
and its value:

command_ok(
	[
		'pg_dump',
		('--schema', 'pg_catalog'),
		('-f', $outputdir . '/catalogs_primary.dump'),
		'--no-sync',
		('-p', $node_primary->port),
		'--no-unlogged-table-data',
		'regression'
	],
	'dump catalogs of primary server');

I think the fat comma is much nicer than this, so I'd like to convert
these too (and replace some of the concatenations with interpolation).

Technically the quotes aren't necessary around single-dash options
before => since unary minus works on strings as well as numbers, but
I'll leave them in for consistency.

- ilmari





view thread (43+ messages)  latest in thread

Message-ID: <87jzc46d8u.fsf@wibble.ilmari.org>
Permalink:  ../87jzc46d8u.fsf@wibble.ilmari.org/
Also on:    postgresql.org/message-id/87jzc46d8u.fsf@wibble.ilmari.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: ilmari@ilmari.org, tgl@sss.pgh.pa.us, andrew@dunslane.net, smithpb2250@gmail.com, michael@paquier.xyz, pgsql-hackers@lists.postgresql.org
  Subject: Re: pg_createsubscriber TAP test wrapping makes command options hard to read.
  In-Reply-To: <87jzc46d8u.fsf@wibble.ilmari.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox