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.96) (envelope-from ) id 1vb0lX-00HXkb-10 for pgsql-hackers@arkaria.postgresql.org; Wed, 31 Dec 2025 18:17:48 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vb0lW-0071d6-05 for pgsql-hackers@arkaria.postgresql.org; Wed, 31 Dec 2025 18:17:46 +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.96) (envelope-from ) id 1vb0lV-0071cw-1z for pgsql-hackers@lists.postgresql.org; Wed, 31 Dec 2025 18:17:46 +0000 Received: from mail-ej1-x62d.google.com ([2a00:1450:4864:20::62d]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1vb0lU-003XD4-00 for pgsql-hackers@lists.postgresql.org; Wed, 31 Dec 2025 18:17:45 +0000 Received: by mail-ej1-x62d.google.com with SMTP id a640c23a62f3a-b7ffa421f1bso2055400166b.0 for ; Wed, 31 Dec 2025 10:17:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jeltef.nl; s=google; t=1767205061; x=1767809861; darn=lists.postgresql.org; h=in-reply-to:references:from:to:subject:cc:message-id:date :content-transfer-encoding:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=YyN3Vn5XBRdxMRkE51UlYMp4911pvdDR3tYmrP+pRlw=; b=NG9kGaqxrQtN+t4n4OL6RCrXGiukNQpTC5X9W2LRjDtAwxz5Sp9ku1jLojB2okvkT1 j3HuwMWdNfm1q30x7cjc/nmD34mj4AD5wJxyUxhC28cwD4dskU249zv+bczahcMtEWvM yX+JC710Jos/U6o7enIoVClYNZOX2G4D+JES0SsQjkSlvDxplDRI04TgBrIq2SMWp1yX OK8qypus/CRaTvggN3pxqd5ceCnacl6A9xLlyqhGUR3rSsUZH7+Z5/YsS1gHsct0dEO6 R7DwlZZ3hU9iqETumro3pbQH3djh5F48rYZ04b+VVg+lWxrNjPcPh+Urprl/vXXVXfQS P9EQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1767205061; x=1767809861; h=in-reply-to:references:from:to:subject:cc:message-id:date :content-transfer-encoding:mime-version:x-gm-gg:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=YyN3Vn5XBRdxMRkE51UlYMp4911pvdDR3tYmrP+pRlw=; b=aGMkAmANR8NWHg3ZpkOD9VQcY/NepIhId+AEKqzUYSjn1hXQKlNAa+F9+gQ8Tu8MZF vR2D7HNDIGte9xr3EznptqejJ+4qGwH4H/bivwTkag4QvxhWwQwvc6YTBngVGLpf5o+O 5RKvneJx79XxMoUqminpuV9FcnztW1ng9aDN5ZoSpqVahsOJ5yOOpTlRt+TfZmWEIaNS Pf5tHMnyi9gic7iLLTGdwsvKwZUiVv/cmtcHhHEtDPPRJNPMbqj2X6LwEme6pBSHJDNi 7vuvnOCpho5Yax7ECzmB1EHfqNhctXeCsccLAt2t4h2+23krRA98Ch4LFvbTn47thMFm WWwA== X-Gm-Message-State: AOJu0Yze4OJgdvrkmxTz2uRzrhUJBupM/pouIsYVHqizYpGQ5UX3feqY nqW7srMtuvp7CkuupQ1w7bRClja1HQuCbcf91CLlg2BY7Zu8QptDyDpFyhWGEIGd+Rc= X-Gm-Gg: AY/fxX4fjFWsvG8RpTDSAPFd0qu/MLyByfTqv9FjQnk5oQnzDcP+lGbK9XVX+HP9zei nQ2fer2YpkhRhLmcijCHJCM/UwSsCkdSwb3Eu85BuCSXFhXHc6TlZd9vPkQN7d0OS6gTvfbzrGu gKxY6RWkyCizAcKRBuQ/UXke1BUHXYq+4AEBPsjO59mpXDLvR/Lii47cSlVkxbeXe9Oj6fPcIYK djRVspEN4a98Xs/78CcpDczuZRCCUIRWpVVA1u6biNXtpkCeWi27fXn6+4fBOBvDcdJcXa5O88W 7rYg8ycPootEQgj7fJx7MS4hqmEDbwETMRKqkwqLGosb+F6c1NP+VUUHA5fLfxRFElrGVoemsSD 96IKKO53ZrfR9rXVo6gf21srz3R/qSiDr/nmw2CqrUKcKGeX0XqsY/iR9Us/LfAvrYC6poHbYGw S4njB7tsip2WwS3jg9zghlt0woAGyAgtAXeL4= X-Google-Smtp-Source: AGHT+IHzSjwddXxuFcz6P0qC5TyRPfQRfXtTBGPdvyqpzfaLnipxMBVAtOgrHw+d1h9x+vMnvallfw== X-Received: by 2002:a17:907:960d:b0:b73:9222:6a64 with SMTP id a640c23a62f3a-b80355b7995mr4298150166b.3.1767205060432; Wed, 31 Dec 2025 10:17:40 -0800 (PST) Received: from localhost (145-53-221-196.fixed.kpn.net. [145.53.221.196]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-b8037a62973sm4079873266b.6.2025.12.31.10.17.39 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 31 Dec 2025 10:17:40 -0800 (PST) Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8; format=Flowed Date: Wed, 31 Dec 2025 19:17:39 +0100 Message-Id: Cc: "PostgreSQL Hackers" , "Daniel Gustafsson" Subject: Re: Add "format" target to make and ninja to run pgindent and pgperltidy To: "Tom Lane" , "Ashutosh Bapat" From: "Jelte Fennema-Nio" X-Mailer: aerc 0.20.1-31-gf6db7c329ce0 References: <3913298.1767194804@sss.pgh.pa.us> In-Reply-To: <3913298.1767194804@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Wed Dec 31, 2025 at 4:26 PM CET, Tom Lane wrote: > Ashutosh Bapat writes: >> On Wed, Dec 31, 2025 at 5:06=E2=80=AFPM Jelte Fennema-Nio wrote: >>> This tries to make running formatting a lot easier for committers, but >>> primarily for new contributors. > >> I generally like the idea. Since perltidy is not enforced regularly >> (like pgindent), running it usually ends up modifying files which are >> not part of the patch. So I avoid it if not necessary. Do you propose >> to make it optional? > > The other obstacle is that not everybody will have the right version > of perltidy installed, but using some other version will create a > whole lot of extraneous noise. > > On the whole I'd recommend not trying to automate the perltidy > step yet. Cost/benefit is just not very good. I would like to get to a point where it is enforced for every commit pushed by committers, so the same as with pgindent. I agree that the cost/benefit is not there currently, but that's what this patchset is trying to address. The docs in the last patch try to explain clearly how to get and configure the correct version of perltidy. And once you've done that it's as easy as running a single make/ninja command to format all the files. Do you think that's not still not easy enough for committers? What would be needed instead? Automatically fetching and installing perltidy to the local build path when running make/ninja format? > On the substance of the patch: I wonder whether we could make things > more reliable by using git metadata to figure out which .h and .c > files to point pgindent at. I think that would definitely be helpful. The fact that pgindent runs on files in the meson build directory when passing "." would be solved by that= .