Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Z9ZeF-0004Wt-LC for pgsql-committers@arkaria.postgresql.org; Mon, 29 Jun 2015 14:02:59 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1Z9ZeF-0000aa-4S for pgsql-committers@arkaria.postgresql.org; Mon, 29 Jun 2015 14:02:59 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1Z9Zdz-0000NV-Ch for pgsql-committers@postgresql.org; Mon, 29 Jun 2015 14:02:43 +0000 Received: from relay5-d.mail.gandi.net ([2001:4b98:c:538::197]) by magus.postgresql.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84) (envelope-from ) id 1Z9Zdw-000216-L2 for pgsql-committers@postgresql.org; Mon, 29 Jun 2015 14:02:42 +0000 Received: from mfilter31-d.gandi.net (mfilter31-d.gandi.net [217.70.178.162]) by relay5-d.mail.gandi.net (Postfix) with ESMTP id 5FFA641C0B4; Mon, 29 Jun 2015 16:02:36 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at mfilter31-d.gandi.net Received: from relay5-d.mail.gandi.net ([217.70.183.197]) by mfilter31-d.gandi.net (mfilter31-d.gandi.net [10.0.15.180]) (amavisd-new, port 10024) with ESMTP id z+r17rHVJ34C; Mon, 29 Jun 2015 16:02:35 +0200 (CEST) X-Originating-IP: 98.122.164.227 Received: from [192.168.10.146] (unknown [98.122.164.227]) (Authenticated sender: adsend@dunslane.net) by relay5-d.mail.gandi.net (Postfix) with ESMTPSA id 1CDE641C07F; Mon, 29 Jun 2015 16:02:33 +0200 (CEST) Message-ID: <55914FF8.80108@dunslane.net> Date: Mon, 29 Jun 2015 10:02:32 -0400 From: Andrew Dunstan User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 MIME-Version: 1.0 To: Michael Paquier , Tom Lane CC: pgsql-committers@postgresql.org Subject: Re: pgsql: Run the C portions of guc-file.l through pgindent. References: In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -2.6 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-committers Precedence: bulk Sender: pgsql-committers-owner@postgresql.org On 06/28/2015 09:24 PM, Michael Paquier wrote: > On Mon, Jun 29, 2015 at 9:49 AM, Tom Lane wrote: >> Run the C portions of guc-file.l through pgindent. >> >> Yeah, I know, pretty anal-retentive of me. But we oughta find some >> way to automate this for the .y and .l files. > .y files may be tricky and .l files less. Still one good way to test > such things would be to use something like that and see at least what > happens when doing a run (haven't tested, use at your own risk): > diff --git a/src/tools/pgindent/pgindent b/src/tools/pgindent/pgindent > index 0d3859d..3995214 100755 > --- a/src/tools/pgindent/pgindent > +++ b/src/tools/pgindent/pgindent > @@ -519,6 +519,7 @@ File::Find::find( > (($dev, $ino, $mode, $nlink, $uid, $gid) = lstat($_)) > && -f _ > && /^.*\.[ch]\z/s > + && /^.*\.(h|c|y|l)\z/s > && push(@files, $File::Find::name); > } > }, > > Regards, Try it and see. I would expect it to blow up badly. It should be possible to teach pgindent to extract the C portions of the files, indent them and then replace them. Of course, especially in the case of .y files, that would exclude almost all of the files in many cases. cheers andrew -- Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-committers