Re: WIP pgindent replacement

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: WIP pgindent replacement
Date: 2011-06-22 04:00:16
Message-ID: 4E0168D0.5000602@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 06/21/2011 11:15 PM, Tom Lane wrote:
> Andrew Dunstan<andrew(at)dunslane(dot)net> writes:
>> Attached is a WIP possible replacement for pgindent. Instead of a shell
>> script invoking a mishmash of awk and sed, some of which is pretty
>> impenetrable, it uses a single engine (perl) to do all the pre and post
>> indent processing.
> Hm ... this should offer the chance of running on Windows, but otherwise
> I'm not sure it does very much for us, if you still have to have a
> patched version of NetBSD indent underneath.

Well, to start with it provides a nicer way to invoke pgindent for the
whole repo.

And it will be relatively easy to incorporate new stuff, for example
what Greg Smith was doing in his wrapper script.

It's true that the script contains an unfortunately large number of
workarounds for the limitations and failure modes of the patched bsd
indent we've been using. Some of those are currently working less than
perfectly, and I found it fairly difficult to understand exactly what
they were doing. I hope what I have produced will be a bit clearer and
more maintainable than what it replaces, as well as working a bit better
and more robustly.

>> If anybody is so inclined, this could be used as a basis for removing
>> the use of bsd indent altogether, as has been suggested before, as well
>> as external entab/detab.
> Now *that* I would get excited about. But surely it would be a huge
> amount more work?
>

Yes, which is why I decided to do this - I certainly don't currently
have time to re-implement indent.

cheers

andrew

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Pavel Stehule 2011-06-22 04:01:56 Re: Fwd: Keywords in pg_hba.conf should be field-specific
Previous Message Fujii Masao 2011-06-22 03:54:20 Re: Latch implementation that wakes on postmaster death on both win32 and Unix