From: | Alvaro Herrera <alvherre(at)2ndquadrant(dot)com> |
---|---|
To: | Andres Freund <andres(at)anarazel(dot)de> |
Cc: | Piotr Stefaniak <postgres(at)piotr-stefaniak(dot)me>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Robert Haas <robertmhaas(at)gmail(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: pg_bsd_indent - improvements around offsetof and sizeof |
Date: | 2016-05-25 22:17:51 |
Message-ID: | 20160525221751.GA619972@alvherre.pgsql |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
Andres Freund wrote:
> On 2016-05-25 22:01:53 +0200, Piotr Stefaniak wrote:
> > On 2016-05-25 21:13, Tom Lane wrote:
> > > I'd love to see a fix for its brain damage around function pointer typedef formatting, too.
> >
> > Show me a few examples and I'll look into it.
See src/include/replication/logical.h; the problem there is pretty
obvious.
For another broken construct, see tupleLockExtraInfo in
src/backend/access/heap/heapam.c.
Also, see pre_indent and post_indent in src/tools/pgindent/pgindent.
A few bugs in pg_bsd_indent are worked around there.
> > > I'm excited about this too, not least because it suggests that maybe bsdindent isn't quite as opaque as it appears.
> >
> > It's old, hacked on many times over the past few decades and historically
> > just a band-aid rather than something designed from the ground up, so it's
> > not easy to work with. Which is why I think that a newer tool (like
> > ClangFormat) should be considered as a replacement for pg_bsd_indent.
>
> FWIW, I looked at using clang-format at some point, and it looked like
> it'd be a number of additional options to make it work for our case
> without changing the code layout too much. There seemed limited
> enthusiasm from the authors about accepting relevant options.
FWIW I looked at GNU indent a year ago or so, and there were a few
things about our style that they simply did not have options for. I
don't recall the details but my conclusion was that it was a dead end.
--
Álvaro Herrera http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
From | Date | Subject | |
---|---|---|---|
Next Message | Andres Freund | 2016-05-25 22:19:48 | Re: pg_bsd_indent - improvements around offsetof and sizeof |
Previous Message | Tom Lane | 2016-05-25 21:50:41 | Re: statistics for shared catalogs not updated when autovacuum is off |