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 1pqBdm-0005m2-Pv for pgsql-hackers@arkaria.postgresql.org; Sat, 22 Apr 2023 11:42:54 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pqBdk-0005uT-Oa for pgsql-hackers@arkaria.postgresql.org; Sat, 22 Apr 2023 11:42:52 +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 1pqBdk-0005uJ-9H for pgsql-hackers@lists.postgresql.org; Sat, 22 Apr 2023 11:42:52 +0000 Received: from relay5-d.mail.gandi.net ([217.70.183.197]) by makus.postgresql.org with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1pqBdg-001FxW-LC for pgsql-hackers@postgresql.org; Sat, 22 Apr 2023 11:42:50 +0000 Received: (Authenticated sender: adsend@dunslane.net) by mail.gandi.net (Postfix) with ESMTPSA id 654341C0003; Sat, 22 Apr 2023 11:42:39 +0000 (UTC) Content-Type: multipart/alternative; boundary="------------DjB0V0CcCtjmu19jIQsVka6v" Message-ID: <582c503b-cd98-1891-ff87-9c8e8ce73ee5@dunslane.net> Date: Sat, 22 Apr 2023 07:42:36 -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: Michael Paquier , Jelte Fennema Cc: "shiy.fnst@fujitsu.com" , Robert Haas , Tom Lane , Justin Pryzby , Andres Freund , Noah Misch , Peter Geoghegan , Bruce Momjian , Magnus Hagander , Alvaro Herrera , Stephen Frost , Jesse Zhang , "pgsql-hackers@postgresql.org" , Peter Eisentraut References: <3d67bc80-4de2-5ba8-e272-e4ad2e59ba04@dunslane.net> <4ac8f263-f1bb-faa5-a307-1fffe00f0e3e@dunslane.net> <0f074818-b01a-799f-3c74-5fb5deab1d23@dunslane.net> <1d66447e-a77b-ca0d-90a0-782800e85383@dunslane.net> From: Andrew Dunstan In-Reply-To: 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. --------------DjB0V0CcCtjmu19jIQsVka6v Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 2023-04-22 Sa 04:50, Michael Paquier wrote: > On Fri, Apr 21, 2023 at 09:58:17AM +0200, Jelte Fennema wrote: >> For 2 the upstream thread listed two approaches: >> a. Install a pre-receive git hook on the git server that rejects >> pushes to master that are not indented >> b. Add a test suite that checks if the code is correctly indented, so >> the build farm would complain about it. (Suggested by Peter E) >> >> I think both a and b would work to achieve 2. But as Peter E said, b >> indeed sounds like less of a divergence of the status quo. So my vote >> would be for b. > FWIW, I think that there is value for both of them. Anyway, isn't 'a' > exactly the same as 'b' in design? Both require a build of > pg_bsd_indent, meaning that 'a' would also need to run an equivalent > of the regression test suite, but it would be actually costly > especially if pg_bsd_indent itself is patched. I think that getting > more noisy on this matter with 'b' would be enough, but as an extra > PG_TEST_EXTRA for committers to set. > > Such a test suite would need a dependency to the 'git' command itself, > which is not something that could be safely run in a release tarball, > in any case. Perhaps we should start with a buildfarm module, which would run pg_indent --show-diff. That would only need to run on one animal, so a failure wouldn't send the whole buildfarm red. This would be pretty easy to do. cheers andrew -- Andrew Dunstan EDB:https://www.enterprisedb.com --------------DjB0V0CcCtjmu19jIQsVka6v Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit


On 2023-04-22 Sa 04:50, Michael Paquier wrote:
On Fri, Apr 21, 2023 at 09:58:17AM +0200, Jelte Fennema wrote:
For 2 the upstream thread listed two approaches:
a. Install a pre-receive git hook on the git server that rejects
pushes to master that are not indented
b. Add a test suite that checks if the code is correctly indented, so
the build farm would complain about it. (Suggested by Peter E)

I think both a and b would work to achieve 2. But as Peter E said, b
indeed sounds like less of a divergence of the status quo. So my vote
would be for b.
FWIW, I think that there is value for both of them.  Anyway, isn't 'a'
exactly the same as 'b' in design?  Both require a build of
pg_bsd_indent, meaning that 'a' would also need to run an equivalent
of the regression test suite, but it would be actually costly
especially if pg_bsd_indent itself is patched.  I think that getting
more noisy on this matter with 'b' would be enough, but as an extra
PG_TEST_EXTRA for committers to set.

Such a test suite would need a dependency to the 'git' command itself,
which is not something that could be safely run in a release tarball,
in any case.


Perhaps we should start with a buildfarm module, which would run pg_indent --show-diff. That would only need to run on one animal, so a failure wouldn't send the whole buildfarm red. This would be pretty easy to do.


cheers


andrew

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