Re: Run pgindent now?

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Andres Freund <andres(at)anarazel(dot)de>, Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, Robert Haas <robertmhaas(at)gmail(dot)com>, Magnus Hagander <magnus(at)hagander(dot)net>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Run pgindent now?
Date: 2015-05-24 12:31:32
Message-ID: 20150524123132.GF28512@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sat, May 23, 2015 at 11:37:30PM -0400, Tom Lane wrote:
> Bruce Momjian <bruce(at)momjian(dot)us> writes:
> > On Sun, May 24, 2015 at 04:16:07AM +0200, Andres Freund wrote:
> >> - if (IsA(node, Aggref) || IsA(node, GroupingFunc))
> >> + if (IsA(node, Aggref) ||IsA(node, GroupingFunc))
> >>
> >> There's a bunch of changes like this. Looks rather odd to me? I don't
> >> recall seing much code looking like that?
>
> > Wow, that is quite odd.
>
> No, pgindent has *always* been wonky about lines that contain a typedef
> name but are not variable declarations. I've gotten in the habit of
> breaking IsA tests like these into two lines:
>
> if (IsA(node, Aggref) ||
> IsA(node, GroupingFunc))
>
> just so that it doesn't look weird when pgindent gets done with it.
> You can see similar weirdness around sizeof usages, if you look.

Oh, I checked if IsA was a typedef, but it isn't. I see now the problem
is the Aggref typedef on the line.

> >> Also, does somebody have an idea to keep pgindent from butchering inline
> >> asm like:
>
> > Ah, we have a file /pgtop/src/tools/pgindent/exclude_file_patterns which
> > has excluded files, and s_lock.h is one of them. I think
> > /include/port/atomics/arch-x86.h needs to be added, and the pgindent
> > commit on the file reverted.
>
> Yeah, probably :-(

OK, will do. I am going to revert and exclude the entire
include/port/atomics directory.

--
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://enterprisedb.com

+ Everyone has their own god. +

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Dunstan 2015-05-24 14:07:05 Re: Run pgindent now?
Previous Message Nils Goroll 2015-05-24 11:42:57 Re: xid wrap / optimize frozen tables?