Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qVdiE-000ncH-N9 for pgsql-hackers@arkaria.postgresql.org; Mon, 14 Aug 2023 19:58:50 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1qVdiC-007Cr7-VA for pgsql-hackers@arkaria.postgresql.org; Mon, 14 Aug 2023 19:58:49 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qVdiC-007Cqx-K1 for pgsql-hackers@lists.postgresql.org; Mon, 14 Aug 2023 19:58:48 +0000 Received: from relay9-d.mail.gandi.net ([217.70.183.199]) by makus.postgresql.org with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qVdi9-0008Q7-7m for pgsql-hackers@postgresql.org; Mon, 14 Aug 2023 19:58:47 +0000 Received: by mail.gandi.net (Postfix) with ESMTPSA id 48F5FFF802; Mon, 14 Aug 2023 19:58:35 +0000 (UTC) Content-Type: multipart/alternative; boundary="------------J97KGP1vO1LyxIG0z9L0Xnby" Message-ID: Date: Mon, 14 Aug 2023 15:58:34 -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: Peter Eisentraut , Andres Freund Cc: Tom Lane , Peter Geoghegan , Jelte Fennema , Michael Paquier , "shiy.fnst@fujitsu.com" , Robert Haas , Justin Pryzby , Noah Misch , Bruce Momjian , Magnus Hagander , Alvaro Herrera , Stephen Frost , Jesse Zhang , "pgsql-hackers@postgresql.org" , Peter Eisentraut References: <30a72ba4-9ca4-15b5-db0f-0e68cba7ab26@dunslane.net> <1f594a4b-14c8-e159-b250-edf8a091320d@dunslane.net> <20230811212511.aih23qfthi24zhq4@awork3.anarazel.de> <338202.1691793002@sss.pgh.pa.us> <342032.1691794926@sss.pgh.pa.us> <8c4d8afb-cda1-299c-8011-f60cdaff3999@dunslane.net> <20230812211404.sydbwo2juu7vyhtg@awork3.anarazel.de> <645add52-2ed3-970d-c9e4-a1294669fb57@eisentraut.org> From: Andrew Dunstan In-Reply-To: <645add52-2ed3-970d-c9e4-a1294669fb57@eisentraut.org> X-GND-Sasl: adsend@dunslane.net 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. --------------J97KGP1vO1LyxIG0z9L0Xnby Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 2023-08-14 Mo 10:04, Peter Eisentraut wrote: > On 12.08.23 23:14, Andres Freund wrote: >> It's a somewhat annoying task though, find all the typedefs, add them >> to the >> right place in the file (we have an out of order entry right now). I >> think a >> script that*adds*  (but doesn't remove) local typedefs would make >> this less >> painful. > > I was puzzled once that there does not appear to be such a script > available.  Whatever the buildfarm does (before it merges it all > together) should be available locally.  Then the workflow could be > > type type type > compile > update typedefs > pgindent > commit It's a bit more complicated :-) You can see what the buildfarm does at It's been somewhat fragile over the years, which most people other than Tom and I have probably not noticed. On most platforms it needs postgres to have been installed before looking for the typedefs. cheers andrew -- Andrew Dunstan EDB:https://www.enterprisedb.com --------------J97KGP1vO1LyxIG0z9L0Xnby Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit


On 2023-08-14 Mo 10:04, Peter Eisentraut wrote:
On 12.08.23 23:14, Andres Freund wrote:
It's a somewhat annoying task though, find all the typedefs, add them to the
right place in the file (we have an out of order entry right now). I think a
script that*adds*  (but doesn't remove) local typedefs would make this less
painful.

I was puzzled once that there does not appear to be such a script available.  Whatever the buildfarm does (before it merges it all together) should be available locally.  Then the workflow could be

type type type
compile
update typedefs
pgindent
commit



It's a bit more complicated :-)

You can see what the buildfarm does at <https://github.com/PGBuildFarm/client-code/blob/ec4cf43613a74cb88f228efcde09931cf9fd57e7/run_build.pl#L2562> It's been somewhat fragile over the years, which most people other than Tom and I have probably not noticed.

On most platforms it needs postgres to have been installed before looking for the typedefs.


cheers


andrew

--
Andrew Dunstan
EDB: https://www.enterprisedb.com
--------------J97KGP1vO1LyxIG0z9L0Xnby--