Re: [HACKERS] Running pgindent - Mailing list pgsql-hackers

From Bruce Momjian
Subject Re: [HACKERS] Running pgindent
Date
Msg-id 199802250025.TAA26711@candle.pha.pa.us
Whole thread Raw
In response to Re: [HACKERS] Running pgindent  ("Thomas G. Lockhart" <lockhart@alumni.caltech.edu>)
Responses Re: [HACKERS] Running pgindent  (Peter T Mount <psqlhack@maidast.demon.co.uk>)
List pgsql-hackers
> Well, *&^*^#$! I wasted hours cleaning up some of what I considered damage from
> the last pass through.
> Would it be possible to pass back through (i.e. pipe indent output to a filter)
> and fix at least points (1) and (2)? _That_ would be pretty easy to automate
> since the heuristics can be pretty simple:
>
> if (first char is nonwhitespace) && (next word is "*") && (next line starts with
> word+paren)
> then compress whitespace
>
> else if (first char is "}") && (next word is "/*")
> then compress whitespace
>
> else
> write line as-is
>
> I'll write the perl if you would be willing to use it?

OK, I have changed pgindent to reflect the new structure names, and have
made your requested changes.  For #1, if the line began with an alpha,
and ends with a *, I remove tabs/spaces before the * and make it only
one space.  Let me know how you like the changes.

I have not run it on the source yet because people are still holding
patches.


--
Bruce Momjian                          |  830 Blythe Avenue
maillist@candle.pha.pa.us              |  Drexel Hill, Pennsylvania 19026
  +  If your life is a hard drive,     |  (610) 353-9879(w)
  +  Christ can be your backup.        |  (610) 853-3000(h)

pgsql-hackers by date:

Previous
From: t-ishii@sra.co.jp (Tatsuo Ishii)
Date:
Subject: Re: [HACKERS] Who is everyone?
Next
From: ocie@paracel.com
Date:
Subject: Compiling under Solaris