Re: WIP pgindent replacement

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Andrew Dunstan <andrew(at)dunslane(dot)net>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: WIP pgindent replacement
Date: 2011-06-22 02:18:49
Message-ID: 201106220218.p5M2InB08144@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Andrew Dunstan wrote:
>
> 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. Of course, if your regex-fu and perl-fu is not up the
> scratch this too might be impenetrable, but all but a couple of the
> recipes are reduced to single lines, and I'd argue that they are all at
> least as comprehensible as what they replace.

I am excited Andrew has done this. It has been on my TODO list for a
while --- I was hoping someday we could switch to GNU indent but gave up
after the GNU indent report from Greg Stark that exactly matched my
experience years ago:

http://archives.postgresql.org/pgsql-hackers/2011-04/msg01436.php

Basically, GNU indent has new bugs, but bugs that are harder to work
around than the BSD indent bugs.

Once I heard that I realized we were going to be using BSD indent for
many more years to come and rewriting the shell script in Perl was the
next logical step, which Andrew has done.

This will also allow us to use pgindent on Windows that has Perl
installed --- we should create a DOS binary of bsd indent so Windows
users scan run it.

I would also like to add a command-line way to detect our patched
version of BSD indent so we know we are using the right binary. I will
do that once the Perl version is committed to git.

Thanks Andrew.

--
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://enterprisedb.com

+ It's impossible for everything to be true. +

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2011-06-22 02:21:43 pgsql: Add notion of a "transform function" that can simplify function
Previous Message Robert Haas 2011-06-22 02:09:48 Re: Auto Start second postgres 8.3.15-1 instance MAC OS X