Fixes for 8.1 run of pgindent

Поиск
Список
Период
Сортировка
От Bruce Momjian
Тема Fixes for 8.1 run of pgindent
Дата
Msg-id 200511150054.jAF0sFD13867@candle.pha.pa.us
обсуждение исходный текст
Ответ на Re: broken comment justification logic in new pgindent  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: Fixes for 8.1 run of pgindent  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
Tom Lane wrote:
> Bruce Momjian <pgman@candle.pha.pa.us> writes:
> > My guess is that there is a one-off bug in there.
> 
> At least a two-off ... but I think it's more likely some sort of
> wrong-state error, given the narrow places where it happens.  I have not
> observed any non-comment code being mis-justified, for instance.

OK, I have spent some unpleasant time tracking down the pgindent
problems from 8.1.  Some were my fault, and some the BSD indent code.

First, my fault was not updating the typedefs for both /bin and /lib ---
I did only /bin.  This was documented, but not clearly.  I have improved
the docs on this.

Second, Tom found that when we took the margin to 79, BSD indent had a
bug that the first line after a blank comment line could go to 80 or 81
columns.  I tracked down this bug and applied a fix to my version, the
patch in our CVS, and the indent tarball on our ftp server.

Third, I found that if more then 150 'else if' are used in the same
statement, the comments are shifted to start on column 100.  I have
found the cause for this (stack of 150 hardcoded) and fixed that too
everywhere. I have rerun pgindent on psql/tab-complete.c and committed it
to CVS for both branches.

I have tested the new pgindent on our existing CVS and the only changes
are for comments to fix the bad wrapping, and to fix the missing /lib
typedefs.

I think we should rerun pgindent on 8.1.X and HEAD to correct the
reported problems.  I am betting 90% of our patches either come from
CVS head or 8.1.X branches greater than 8.1.0.

I have on my TODO list to test GNU indent again during 8.2 to see how it
does.

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


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: outer joins and for update
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Fixes for 8.1 run of pgindent