Re: pg_bsd_indent - improvements around offsetof and sizeof

From: Piotr Stefaniak <postgres(at)piotr-stefaniak(dot)me>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: pg_bsd_indent - improvements around offsetof and sizeof
Date: 2016-08-15 18:09:02
Message-ID: AM4PR03MB1586BC7EC6F178A2BA591376F2120@AM4PR03MB1586.eurprd03.prod.outlook.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2016-05-25 21:13, Tom Lane wrote:
> Robert Haas <robertmhaas(at)gmail(dot)com> writes:
>> On Sun, May 22, 2016 at 4:16 PM, Piotr Stefaniak
>> <postgres(at)piotr-stefaniak(dot)me> wrote:
>>> I think I've managed to improve pg_bsd_indent's handling of two types of
>>> cases.
>
>> Wow, that seems pretty great. I haven't scrutinized your changes to
>> pg_bsd_indent, but effect_on_pg.diff looks like a large improvement.

> Assuming this patch withstands more careful review, we will need to think
> about project policy for how/when to apply such fixes.

The patches have got committed upstream and work well for Postgres. You
can take FreeBSD indent(1) as of SVN r303746, apply patches from
https://github.com/pstef/freebsd_indent/commits/pass2 (subject to heavy
rebasing) and use as pg_bsd_indent for pgindent.

There are more fixes I intend to do, of which the most relevant for
Postgres are:
1) fixing "function pointer typedef formatting"
2) adding a -tsn option like in GNU indent, for setting how many columns
a tab character will produce. I had a preliminary patch implementing
that and I have to say that while it removes the need for entab, it also
introduces a lot of seemingly pointless changes in formatting which will
be arguably improvements or regressions.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Dave Cramer 2016-08-15 18:19:05 Re: Slowness of extended protocol
Previous Message Anastasia Lubennikova 2016-08-15 18:09:01 Re: Pluggable storage