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 1k60cl-0005Dt-Am for pgsql-hackers@arkaria.postgresql.org; Wed, 12 Aug 2020 23:57:39 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1k60ci-00071C-Ts for pgsql-hackers@arkaria.postgresql.org; Wed, 12 Aug 2020 23:57:36 +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 1k60ci-000715-Mx for pgsql-hackers@lists.postgresql.org; Wed, 12 Aug 2020 23:57:36 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1k60cf-000712-Qv for pgsql-hackers@postgresql.org; Wed, 12 Aug 2020 23:57:36 +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 07CNvTB0328502; Wed, 12 Aug 2020 19:57:29 -0400 From: Tom Lane To: Andres Freund cc: Jesse Zhang , PostgreSQL-development Subject: Re: run pgindent on a regular basis / scripted manner In-reply-to: <20200812232320.3osjntz7r7nrg7iu@alap3.anarazel.de> References: <20200812223409.6di3y2qsnvynao7a@alap3.anarazel.de> <20200812232320.3osjntz7r7nrg7iu@alap3.anarazel.de> Comments: In-reply-to Andres Freund message dated "Wed, 12 Aug 2020 16:23:20 -0700" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <328500.1597276649.1@sss.pgh.pa.us> Date: Wed, 12 Aug 2020 19:57:29 -0400 Message-ID: <328501.1597276649@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Andres Freund writes: > Unfortunately that is, with the current tooling, not entirely trivial to > do so completely. The way we generate the list of known typedefs > unfortunately depends on the platform a build is run on. Therefore the > buildfarm collects a number of the generated list of typedefs from > different platforms, and then we use that combined list to run pgindent. Yeah, it's hard to see how to avoid that given that the set of typedefs provided by system headers is not fixed. (Windows vs not Windows is the worst case of course, but Unixen aren't all alike either.) Another gotcha that we have to keep our eyes on is that sometimes the process finds spurious names that we don't want to treat as typedefs because it results in messing up too much code. There's a reject list in pgindent that takes care of those, but it has to be maintained manually. So I'm not sure how that could work in conjunction with unsupervised reindents --- by the time you notice a problem, the git history will already be cluttered with bogus reindentations. Maybe the secret is to not allow automated adoption of new typedefs.list entries, but to require somebody to add entries to that file by hand, even if they're basing it on the buildfarm results. (This would encourage the habit some people have adopted of updating typedefs.list along with commits that add typedefs. I've never done that, but would be willing to change if there's good motivation to.) regards, tom lane