Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pt6cj-0005Xu-Ji for pgsql-hackers@arkaria.postgresql.org; Sun, 30 Apr 2023 12:57:53 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pt6ch-0006fS-7n for pgsql-hackers@arkaria.postgresql.org; Sun, 30 Apr 2023 12:57:51 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pt6cg-0006fH-UC for pgsql-hackers@lists.postgresql.org; Sun, 30 Apr 2023 12:57:50 +0000 Received: from relay9-d.mail.gandi.net ([217.70.183.199]) by magus.postgresql.org with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1pt6cd-005ycw-Ah for pgsql-hackers@postgresql.org; Sun, 30 Apr 2023 12:57:49 +0000 Received: (Authenticated sender: adsend@dunslane.net) by mail.gandi.net (Postfix) with ESMTPSA id 0D075FF806; Sun, 30 Apr 2023 12:57:40 +0000 (UTC) Content-Type: multipart/alternative; boundary="------------3ZCNTcdCGMBbmNOwLfodM9b6" Message-ID: <5b9dede4-3c70-b8c1-c53e-26cdf4125b35@dunslane.net> Date: Sun, 30 Apr 2023 08:57:39 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.5.0 Subject: Re: run pgindent on a regular basis / scripted manner Content-Language: en-US To: Alvaro Herrera Cc: Andres Freund , Noah Misch , Tom Lane , Jelte Fennema , Peter Geoghegan , Bruce Momjian , Magnus Hagander , Stephen Frost , Jesse Zhang , PostgreSQL-development References: <20230428092545.qfb3y5wcu4cm75ur@alvherre.pgsql> From: Andrew Dunstan In-Reply-To: <20230428092545.qfb3y5wcu4cm75ur@alvherre.pgsql> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk This is a multi-part message in MIME format. --------------3ZCNTcdCGMBbmNOwLfodM9b6 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 2023-04-28 Fr 05:25, Alvaro Herrera wrote: > On 2023-Feb-05, Andrew Dunstan wrote: > >> So here's a diff made from running perltidy v20221112 with the additional >> settingĀ --valign-exclusion-list=", = => || && if unless" > I ran this experimentally with perltidy 20230309, and compared that with > the --novalign behavior (not to propose the latter -- just to be aware > of what else is vertical alignment doing.) Thanks for looking. > > Based on the differences between both, I think we'll definitely want to > include =~ and |= in this list, and I think we should discuss whether to > also include "or" (for "do_stuff or die()" type of constructs) and "qw" > (mainly used in 'use Foo qw(one two)' import lists). All these have > effects (albeit smaller than the list you gave) on our existing code. I'm good with all of these I think > > > If you change from an exclusion list to --novalign then you lose > alignment of trailing # comments, which personally I find a loss, even > though they're still a multi-line effect. Another change would be that > it ditches alignment of "{" but that only changes msvc/Install.pm, so I > think we shouldn't worry; and then there's this one: > > -use PostgreSQL::Test::Utils (); > +use PostgreSQL::Test::Utils (); > use PostgreSQL::Test::BackgroundPsql (); > > which I think we could just change to qw() if we cared enough (but I bet > we don't). Yeah, me too. > > > All in all, I think sticking to > --valign-exclusion-list=", = => =~ |= || && if or qw unless" > is a good deal. > wfm cheers andrew -- Andrew Dunstan EDB:https://www.enterprisedb.com --------------3ZCNTcdCGMBbmNOwLfodM9b6 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit


On 2023-04-28 Fr 05:25, Alvaro Herrera wrote:
On 2023-Feb-05, Andrew Dunstan wrote:

So here's a diff made from running perltidy v20221112 with the additional
settingĀ --valign-exclusion-list=", = => || && if unless"
I ran this experimentally with perltidy 20230309, and compared that with
the --novalign behavior (not to propose the latter -- just to be aware
of what else is vertical alignment doing.)


Thanks for looking.



Based on the differences between both, I think we'll definitely want to
include =~ and |= in this list, and I think we should discuss whether to
also include "or" (for "do_stuff or die()" type of constructs) and "qw"
(mainly used in 'use Foo qw(one two)' import lists).  All these have
effects (albeit smaller than the list you gave) on our existing code.


I'm good with all of these I think




If you change from an exclusion list to --novalign then you lose
alignment of trailing # comments, which personally I find a loss, even
though they're still a multi-line effect.  Another change would be that
it ditches alignment of "{" but that only changes msvc/Install.pm, so I
think we shouldn't worry; and then there's this one:

-use PostgreSQL::Test::Utils          ();
+use PostgreSQL::Test::Utils ();
 use PostgreSQL::Test::BackgroundPsql ();

which I think we could just change to qw() if we cared enough (but I bet
we don't).


Yeah, me too.




All in all, I think sticking to
--valign-exclusion-list=", = => =~ |= || && if or qw unless"
is a good deal.


wfm


cheers


andrew

--
Andrew Dunstan
EDB: https://www.enterprisedb.com
--------------3ZCNTcdCGMBbmNOwLfodM9b6--