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 1pJGRc-0002pz-UX for pgsql-hackers@arkaria.postgresql.org; Sat, 21 Jan 2023 16:10:16 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pJGRb-0007LK-I1 for pgsql-hackers@arkaria.postgresql.org; Sat, 21 Jan 2023 16:10:15 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pJGRb-0007LB-8q for pgsql-hackers@lists.postgresql.org; Sat, 21 Jan 2023 16:10:15 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pJGRW-0004Zs-2f for pgsql-hackers@lists.postgresql.org; Sat, 21 Jan 2023 16:10:14 +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 30LGA8Sk912485; Sat, 21 Jan 2023 11:10:08 -0500 From: Tom Lane To: Andrew Dunstan cc: pgsql-hackers@lists.postgresql.org Subject: Re: run pgindent on a regular basis / scripted manner In-reply-to: References: <20200814202651.GA31108@alvherre.pgsql> <531251.1674234545@sss.pgh.pa.us> <20230120175806.iogdcra2xpmmh5de@awork3.anarazel.de> <538672.1674238787@sss.pgh.pa.us> <17455b0f-0161-9aa9-b6dd-1279e947b8f4@dunslane.net> <3cdb09f1-6375-4198-e8c1-e33ca4c96304@dunslane.net> Comments: In-reply-to Andrew Dunstan message dated "Sat, 21 Jan 2023 10:24:02 -0500" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <912483.1674317408.1@sss.pgh.pa.us> Date: Sat, 21 Jan 2023 11:10:08 -0500 Message-ID: <912484.1674317408@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Andrew Dunstan writes: >>> I think we could do better with some automation tooling for committers >>> here. One low-risk and simple change would be to provide a >>> non-destructive mode for pgindent that would show you the changes if any >>> it would make. That could be worked into a git pre-commit hook that >>> committers could deploy. I can testify to the usefulness of such hooks - >>> I have one that while not perfect has saved me on at least two occasions >>> from forgetting to bump the catalog version. That sounds like a good idea from here. I do not think we want a mandatory commit filter, but if individual committers care to work this into their process in some optional way, great! I can think of ways I'd use it during patch development, too. (One reason not to want a mandatory filter is that you might wish to apply pgindent as a separate commit, so that you can then put that commit into .git-blame-ignore-revs. This could be handy for example when a patch needs to change the nesting level of a lot of pre-existing code, without making changes in it otherwise.) >> This time with patch. > ... with typo fixed. Looks reasonable, but you should also update src/tools/pgindent/pgindent.man, which AFAICT is our only documentation for pgindent switches. (Is it time for a --help option in pgindent?) regards, tom lane