pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Daniel Gustafsson <daniel@yesql.se>
Cc: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
Cc: pgsql-hackers <pgsql-hackers@postgresql.org>
Subject: Re: pgindent vs dtrace on macos
Date: Wed, 16 Sep 2020 19:55:17 -0400
Message-ID: <43461.1600300517@sss.pgh.pa.us> (raw)
In-Reply-To: <FDCD46CA-C092-4B1D-B19E-314569AA3D88@yesql.se>
References: <79ed5348-be7a-b647-dd40-742207186a22@2ndquadrant.com>
	<21042.1589983015@sss.pgh.pa.us>
	<fcbe3e68-19f8-ae3b-cf5a-3e420123826b@2ndquadrant.com>
	<FDCD46CA-C092-4B1D-B19E-314569AA3D88@yesql.se>

Daniel Gustafsson <daniel@yesql.se> writes:
> The attached patch fixes the generation of sql_help.h and perl_opmask.h to make
> sure they conform to pgindent.  Those were the only file I got diffs in after a
> pgindent run apart from fmgrprotos.h which gave the below:

Hmm, I seem to recall there were more when this happened to me back in
May.  But in any case, fixing these is an improvement.

> Not sure what pgindent is doing there, but it seems hard to address in the
> generator.

I think the issue is that pgindent believes "numeric" and "chr" are
typedefs.  (The regex code can be blamed for "chr", but I'm not quite
sure where "numeric" is coming from.)  Observe that it also messes up
the definitions of those two functions, not only their extern
declarations.

We could try adding those names to the typedef exclusion list in pgindent,
but that could easily make things worse not better overall.  On balance
I'd say this particular behavior is a pgindent bug, and if anybody is hot
to remove the discrepancy then they ought to try to fix pgindent not the
fmgrprotos generator.

> probes.h is also added to the exclusion list in the patch.

Check.

> On that note, I
> wonder if we should add the plperl .xs generated files as exclusions too since
> we don't control that generator?

Not an issue I don't think; pgindent won't touch extensions other than
.c and .h.

			regards, tom lane





view thread (21+ messages)  latest in thread

Message-ID: <43461.1600300517@sss.pgh.pa.us>
Permalink:  ../43461.1600300517@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/43461.1600300517@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: tgl@sss.pgh.pa.us, daniel@yesql.se, peter.eisentraut@2ndquadrant.com
  Subject: Re: pgindent vs dtrace on macos
  In-Reply-To: <43461.1600300517@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox