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 1qwH3P-00AlzJ-Uh for pgsql-hackers@arkaria.postgresql.org; Fri, 27 Oct 2023 07:14:47 +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 1qwH3N-00CUNe-Md for pgsql-hackers@arkaria.postgresql.org; Fri, 27 Oct 2023 07:14:45 +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 1qwH3N-00CUNW-Ch for pgsql-hackers@lists.postgresql.org; Fri, 27 Oct 2023 07:14:45 +0000 Received: from mail1.dalibo.net ([51.159.93.128] helo=mail.dalibo.com) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qwH3J-0033h1-Mz for pgsql-hackers@postgresql.org; Fri, 27 Oct 2023 07:14:44 +0000 Received: from [192.168.1.87] (59.70.69.37.rev.sfr.net [37.69.70.59]) by mail.dalibo.com (Postfix) with ESMTPSA id B75421F897; Fri, 27 Oct 2023 09:14:38 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=dalibo.com; s=a; t=1698390879; bh=5Mkz7h6TrnIBF2zZi0bpuPgrjvY/W6zl2+JWjyycnEI=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=IfHe3tTEIW9C/uOTEAiXqHHC62q9n9BciLM6Pope3o/MR7NaKdU1cJCeWP47WjD+j HRh841DlR7Cv0ssD72RD8jkycaXSTbzni7wBTU+DFpdwQ+Pcqhh/19LW4LeZz9rvg0 QZhBgkRGhee5Lv0uUAwwLqG8lusTt0irotqKs+OI= Message-ID: <8331c9d408e3e4717c730fde069cec8edd1af356.camel@dalibo.com> Subject: Re: run pgindent on a regular basis / scripted manner From: =?ISO-8859-1?Q?=C9tienne?= BERSAC To: Andrew Dunstan , Robert Haas , Jelte Fennema Cc: Peter Geoghegan , Tom Lane , Andres Freund , Michael Paquier , "shiy.fnst@fujitsu.com" , Justin Pryzby , Noah Misch , Bruce Momjian , Magnus Hagander , Alvaro Herrera , Stephen Frost , Jesse Zhang , "pgsql-hackers@postgresql.org" , Peter Eisentraut Date: Fri, 27 Oct 2023 09:14:38 +0200 In-Reply-To: References: <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> <530189.1691880417@sss.pgh.pa.us> <544112.1691886017@sss.pgh.pa.us> <2620572.1697503500@sss.pgh.pa.us> Organization: DALIBO Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.46.4-2 MIME-Version: 1.0 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hello, > Yes, there's a lot to look out for, and you're a damn sight better at > it=20 > than I am. But we should try to automate the things that can be=20 > automated, even if that leaves many tasks that can't be. I have three > things in my pre-commit hook: a check for catalog updates, a check > for=20 > new typedefs, and an indent check. Could you share your configuration ? Could we provide more helper and integration to help produce consistent code ? For logfmt extension, I configured clang-formatd so that Emacs format the buffer on save. Any editor running clangd will use this. This is ease my mind about formatting. I need to investigate how to use pgindent instead or at lease ensure clang-format produce same output as pgindent. https://gitlab.com/dalibo/logfmt/-/blob/0d808b368e649b23ac06ce2657354b67be3= 98b21/.clang-format Automate nitpicking in CI is good, but checking locally before sending the patch will save way more round-trip. Regards, =C3=89tienne