Re: pgindent complaint of the day

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: pgindent complaint of the day
Date: 2004-10-07 14:17:08
Message-ID: 200410071417.i97EH8f29570@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Tom Lane wrote:
> Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> writes:
> > Tom Lane wrote:
> >> If it were "the else's indent plus one more tab" it would be reasonably
> >> sane; it'd match the indentation of what comes next.
>
> > OK, I can do that but consider:
> > [ other case ]
>
> Just out of curiosity, what will pgindent do when re-run on the file
> with the comment already split to the next line? My experience with
> it so far is that it will not move a comment that starts in column 1,
> but it will feel free to re-indent a comment that has some indentation.
> A reasonable goal here would be that running pgindent a second time does
> not create immediate further changes.

Right. I don't see it moving comments up on to an else line. You are
right that if it is in the first column it will not be properly indented
so I just indent it 4 spaces before passing to BSD indent and that
works:

# workaround for indent bug with 'else' handling
# indent comment so BSD indent will move it
sed 's;\([} ]\)else[ ]*\(/\*.*\)$;\1else\
\2;g' |

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2004-10-07 14:33:51 Re: Two-phase commit
Previous Message Gavin Sherry 2004-10-07 14:07:12 Re: SQL-Invoked Procedures for 8.1