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 1qUxON-00FoPv-CJ for pgsql-hackers@arkaria.postgresql.org; Sat, 12 Aug 2023 22:47:31 +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 1qUxOK-003osp-2R for pgsql-hackers@arkaria.postgresql.org; Sat, 12 Aug 2023 22:47:28 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qUxOJ-003osg-PV for pgsql-hackers@lists.postgresql.org; Sat, 12 Aug 2023 22:47:28 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qUxOC-002A6i-Vr for pgsql-hackers@postgresql.org; Sat, 12 Aug 2023 22:47:27 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 37CMkvHt530190; Sat, 12 Aug 2023 18:46:57 -0400 From: Tom Lane To: Andres Freund cc: Andrew Dunstan , 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 Subject: Re: run pgindent on a regular basis / scripted manner In-reply-to: <20230812211404.sydbwo2juu7vyhtg@awork3.anarazel.de> 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> Comments: In-reply-to Andres Freund message dated "Sat, 12 Aug 2023 14:14:04 -0700" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <530188.1691880417.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Sat, 12 Aug 2023 18:46:57 -0400 Message-ID: <530189.1691880417@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Andres Freund writes: > On 2023-08-12 17:03:37 -0400, Andrew Dunstan wrote: >> My recollection is that missing typedefs cause indentation that kinda s= ticks >> out like a sore thumb. Yeah, it's usually pretty obvious: "typedef *var" gets changed to "typedef * var", and similar oddities. > 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 thi= nk a > script that *adds* (but doesn't remove) local typedefs would make this l= ess > painful. My practice has always been "add typedefs until pgindent doesn't do anything I don't want". If you have a new typedef that doesn't happen to be used in a way that pgindent mangles, it's not that critical to get it into the file right away. regards, tom lane