Re: WIP pgindent replacement - Mailing list pgsql-hackers

From Andrew Dunstan
Subject Re: WIP pgindent replacement
Date
Msg-id 4E0168D0.5000602@dunslane.net
Whole thread Raw
In response to Re: WIP pgindent replacement  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers

On 06/21/2011 11:15 PM, Tom Lane wrote:
> Andrew Dunstan<andrew@dunslane.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


pgsql-hackers by date:

Previous
From: Fujii Masao
Date:
Subject: Re: Latch implementation that wakes on postmaster death on both win32 and Unix
Next
From: Pavel Stehule
Date:
Subject: Re: Fwd: Keywords in pg_hba.conf should be field-specific