Re: pg_bsd_indent - improvements around offsetof and sizeof - Mailing list pgsql-hackers

From Piotr Stefaniak
Subject Re: pg_bsd_indent - improvements around offsetof and sizeof
Date
Msg-id AM4PR03MB1586BC7EC6F178A2BA591376F2120@AM4PR03MB1586.eurprd03.prod.outlook.com
Whole thread Raw
In response to Re: pg_bsd_indent - improvements around offsetof and sizeof  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: pg_bsd_indent - improvements around offsetof and sizeof  (Andres Freund <andres@anarazel.de>)
List pgsql-hackers
On 2016-05-25 21:13, Tom Lane wrote:
> Robert Haas <robertmhaas@gmail.com> writes:
>> On Sun, May 22, 2016 at 4:16 PM, Piotr Stefaniak
>> <postgres@piotr-stefaniak.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.




pgsql-hackers by date:

Previous
From: Anastasia Lubennikova
Date:
Subject: Re: Pluggable storage
Next
From: Andrew Dunstan
Date:
Subject: Re: Why --backup-and-modify-in-place in perltidy config?