Re: pgindent (was Re: [COMMITTERS] pgsql: Preventive maintenance in advance of pgindent run.)

From: Piotr Stefaniak <postgres(at)piotr-stefaniak(dot)me>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: pgindent (was Re: [COMMITTERS] pgsql: Preventive maintenance in advance of pgindent run.)
Date: 2017-05-18 20:27:18
Message-ID: VI1PR03MB119987EDC3126CD6A56CF29CF2E40@VI1PR03MB1199.eurprd03.prod.outlook.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers pgsql-hackers

On 2017-05-17 23:46, Tom Lane wrote:
> I hacked around that by putting back a detab/entab step at the end
> using the existing subroutines in pgindent. That about halved the
> size of the diff, but it's still too big to post. Much of what
> I'm seeing with this version is randomly different decisions about
> how far to indent comments

pgindent doesn't set the -c indent option ("The column in which comments
on code start."), so indent uses the default value of 33 (meaning column
32). If the code pushes the comment further than column 32, indent only
places a single tab between the two just to separate them.

This, given 4-column tabs, should result in placing the comment on
bitSize[INDEX_MAX_KEYS]; from your example onto column 44 - which the
newer version of indent does (if you tell it -ts4), unlike the older
one. I think that this is an improvement.

> It does seem to be handling formatting around sizeof() calls a lot better
> than the old code, as well as function pointer typedefs. So those are
> huge wins. But can we avoid the changes mentioned above? I'd like the
> new version to only differ in ways that are clear improvements.

I don't know how to avoid the improvement. Try removing -ts4 as well as
putting back detab+entab.

In response to

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Piotr Stefaniak 2017-05-18 20:51:48 Re: [COMMITTERS] pgsql: Preventive maintenance in advance of pgindent run.
Previous Message Heikki Linnakangas 2017-05-18 19:22:22 pgsql: Make slab allocator work on platforms with MAXIMUM_ALIGNOF < siz

Browse pgsql-hackers by date

  From Date Subject
Next Message Piotr Stefaniak 2017-05-18 20:51:48 Re: [COMMITTERS] pgsql: Preventive maintenance in advance of pgindent run.
Previous Message Thomas Munro 2017-05-18 20:21:46 Re: different column orders in regression test database