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 1pPPqw-00020E-9S for pgsql-hackers@arkaria.postgresql.org; Tue, 07 Feb 2023 15:25:50 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pPPqu-00022Q-UE for pgsql-hackers@arkaria.postgresql.org; Tue, 07 Feb 2023 15:25:48 +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 1pPPqu-00022H-HK for pgsql-hackers@lists.postgresql.org; Tue, 07 Feb 2023 15:25:48 +0000 Received: from mail-il1-x130.google.com ([2607:f8b0:4864:20::130]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1pPPqr-0003Zs-CF for pgsql-hackers@postgresql.org; Tue, 07 Feb 2023 15:25:47 +0000 Received: by mail-il1-x130.google.com with SMTP id n2so2690393ili.11 for ; Tue, 07 Feb 2023 07:25:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telsasoft-com.20210112.gappssmtp.com; s=20210112; h=user-agent:in-reply-to:content-disposition:mime-version:references :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=tHDGNld1XL4lWQXpPZmX3maMDeIg+t4dEXMUjNEQcs8=; b=aAKhvomYqWqJGAglL86wtj5aRdFPWes5Is5Fbl27gvt3FP7cGW+glsMCNKhh2PHKFs wgx7hJJaL9MWunJG+Wrw5eq6CYIdEUC6m1+VX+GA4caWWSPdp/6NKCvmS052/f3ymTiY KIGTY4VldBa+w4UTqd7YgkQOlpdPzzjqMizOKNE3lcxaPJb/j9eJ/o4AQsSiXBIkXAQr Dag4R2mm9WnhnArGF9K5tGIllins5VhYWCDObNE3FyD43/T33xbf3OY/c/IRfa7hhrB1 JxGreucuhdOPcNFknX/3C4hs6nxKaXXU8wKm+56lNSaA4m8XLztnKAYTWdESpmVh4ljC +w1w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=user-agent:in-reply-to:content-disposition:mime-version:references :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=tHDGNld1XL4lWQXpPZmX3maMDeIg+t4dEXMUjNEQcs8=; b=a9S5yjBRTubQroKwF7KVy+Btc5jPx/1qnQvsRoQTQEsVRhkdtf6fVkqEwmrdf2WNUU pppAWhBvlOYJWH70wkTuuqUre+nkZMWuK4+ABS8iMCK2kTc7OqUGDZOTxuEc55oOsnBM DER7Gm3eAC4cIRk4z8aKGZxsSnNi00qQ+CTh8sEATYchMzQ8YzoJO/nkj0pS0jY27exq ssRV+s/4svVcaBzaw/NxwVw9WWHGCvTTCQyzgzzh+BssbyjRBhO6qLnRNLUT6xA4ZjIg UZCXGKk6ZsJW150EUY1X6Xy1DrOeY89ZyPIb3JhXn1myu6DyLkV6zOMVHvF/vsWh7jhc WABA== X-Gm-Message-State: AO0yUKWmb1X8sQsnvdCZKmQcnXoY35hGnclbEeWYRJRgMqlwkE0DviqZ m5TUy8x8ZD+l1byDplzBAblp6A== X-Google-Smtp-Source: AK7set+h2nesZjaDU/TghL716M7fgoDq7GUZy7E+pP4266DJxm9Ucrmop8XAqvyv0pov581QAE09Jg== X-Received: by 2002:a92:180f:0:b0:311:12ad:4925 with SMTP id 15-20020a92180f000000b0031112ad4925mr3368230ily.2.1675783544321; Tue, 07 Feb 2023 07:25:44 -0800 (PST) Received: from pryzbyj.telsasoft (charmander.telsasoft.com. [50.244.222.1]) by smtp.gmail.com with ESMTPSA id n20-20020a056638121400b003acde48bdc3sm4379575jas.111.2023.02.07.07.25.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Feb 2023 07:25:43 -0800 (PST) Received: by pryzbyj.telsasoft (Postfix, from userid 1000) id D582F80079B; Tue, 7 Feb 2023 09:25:42 -0600 (CST) Date: Tue, 7 Feb 2023 09:25:42 -0600 From: Justin Pryzby To: Tom Lane Cc: Andres Freund , Noah Misch , Andrew Dunstan , Jelte Fennema , Peter Geoghegan , Bruce Momjian , Magnus Hagander , Alvaro Herrera , Stephen Frost , Jesse Zhang , pgsql-hackers@postgresql.org Subject: Re: run pgindent on a regular basis / scripted manner Message-ID: <20230207152542.GH1653@telsasoft.com> References: <20230122223806.3sgew6qswhsczae7@awork3.anarazel.de> <1489276.1674427657@sss.pgh.pa.us> <1708030.1675446770@sss.pgh.pa.us> <20230204041848.GC1896331@rfd.leadboat.com> <20230204113453.vmtnayjvhyg5qqqy@alap3.anarazel.de> <1923921.1675526879@sss.pgh.pa.us> <20230204171101.GF1653@telsasoft.com> <2009472.1675532231@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2009472.1675532231@sss.pgh.pa.us> User-Agent: Mutt/1.9.4 (2018-02-28) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Sat, Feb 04, 2023 at 12:37:11PM -0500, Tom Lane wrote: > Justin Pryzby writes: > Hmmm ... inserting all of those as the default options would likely > make it impossible to update pg_bsd_indent itself with anything like > its current indent style (not that it's terribly consistent about > that). I could see inventing a --postgresql shortcut switch perhaps. Or you could add ./.indent.pro, or ./src/tools/indent.profile for it to read. > > Would you want to make those the default options of the in-tree indent ? > > Or provide a shortcut like --postgresql ? > > But it's not clear to me why you're allergic to the perl wrapper? My allergy is to the totality of the process, not to the perl component. It's a bit weird to enforce a coding style that no upstream indent tool supports. But what's weirder is that, *having forked the indent tool*, it still doesn't implement the desired style, and the perl wrapper tries to work around that. It would be more reasonable if the forked C program knew how to handle the stuff for which the perl script currently has kludges to munge the source code before indenting and then un-munging afterwards. Or if the indentation were handled by the (or a) perl script itself. Or if the perl script handled everything that an unpatched "ident" didn't handle, rather than some things but not others, demanding use of a patched indent as well as a perl wrapper (not just for looping around files and fancy high-level shortcuts like indenting staged files). On the one hand, "indent" ought to handle all the source-munging stuff. On the other hand, it'd be better to use an unpatched indent tool. The current way is the worst of both worlds. Currently, the perl wrapper supports the "/* -"-style comments that postgres wants to use (why?) by munging the source code. That could be supported in pg-bsd-indent with a one line change. I think an even better option would be to change postgres' C files to use "/*-" without a space, which requires neither perl munging nor patching indent. On a less critical note, I wonder if it's a good idea to import pgbsdindent as a git "submodule". -- Justin