Re: Run pgindent now?

Поиск
Список
Период
Сортировка
Искать
От
Peter Eisentraut
Тема
Re: Run pgindent now?
Дата
в 00:25:35
Msg-id
55650EF4.9040300@gmx.net
Ответ на
Re: Run pgindent now? (Andres Freund)
Список
Дерево обсуждения
Run pgindent now? Tom Lane <tgl@sss.pgh.pa.us>
Re: Run pgindent now? Noah Misch <noah@leadboat.com>
Re: Run pgindent now? Magnus Hagander <magnus@hagander.net>
Re: Run pgindent now? Tom Lane <tgl@sss.pgh.pa.us>
Re: Run pgindent now? Bruce Momjian <bruce@momjian.us>
Re: Run pgindent now? Robert Haas <robertmhaas@gmail.com>
Re: Run pgindent now? Tom Lane <tgl@sss.pgh.pa.us>
Re: Run pgindent now? Bruce Momjian <bruce@momjian.us>
Re: Run pgindent now? Tom Lane <tgl@sss.pgh.pa.us>
Re: Run pgindent now? Bruce Momjian <bruce@momjian.us>
Re: Run pgindent now? Andrew Dunstan <andrew@dunslane.net>
Re: Run pgindent now? Andrew Dunstan <andrew@dunslane.net>
Re: Run pgindent now? Tom Lane <tgl@sss.pgh.pa.us>
Re: Run pgindent now? Robert Haas <robertmhaas@gmail.com>
Re: Run pgindent now? Tom Lane <tgl@sss.pgh.pa.us>
Re: Run pgindent now? Robert Haas <robertmhaas@gmail.com>
Re: Run pgindent now? Alvaro Herrera <alvherre@2ndquadrant.com>
Re: Run pgindent now? Tom Lane <tgl@sss.pgh.pa.us>
Re: Run pgindent now? Alvaro Herrera <alvherre@2ndquadrant.com>
Re: Run pgindent now? Tom Lane <tgl@sss.pgh.pa.us>
Re: Run pgindent now? Bruce Momjian <bruce@momjian.us>
Re: Run pgindent now? Tom Lane <tgl@sss.pgh.pa.us>
Re: Run pgindent now? Bruce Momjian <bruce@momjian.us>
Re: Run pgindent now? Andres Freund <andres@anarazel.de>
Re: Run pgindent now? Bruce Momjian <bruce@momjian.us>
Re: Run pgindent now? Tom Lane <tgl@sss.pgh.pa.us>
Re: Run pgindent now? Bruce Momjian <bruce@momjian.us>
Re: Run pgindent now? Bruce Momjian <bruce@momjian.us>
Re: Run pgindent now? Andrew Dunstan <andrew@dunslane.net>
Re: Run pgindent now? Tom Lane <tgl@sss.pgh.pa.us>
Re: Run pgindent now? Bruce Momjian <bruce@momjian.us>
Re: Run pgindent now? Bruce Momjian <bruce@momjian.us>
Re: Run pgindent now? Tom Lane <tgl@sss.pgh.pa.us>
Re: Run pgindent now? Bruce Momjian <bruce@momjian.us>
Re: Run pgindent now? Tom Lane <tgl@sss.pgh.pa.us>
Re: Run pgindent now? Bruce Momjian <bruce@momjian.us>
Re: Run pgindent now? Tom Lane <tgl@sss.pgh.pa.us>
Re: Run pgindent now? Bruce Momjian <bruce@momjian.us>
Re: Run pgindent now? Tom Lane <tgl@sss.pgh.pa.us>
Re: Run pgindent now? Bruce Momjian <bruce@momjian.us>
Re: Run pgindent now? Tom Lane <tgl@sss.pgh.pa.us>
Re: Run pgindent now? Bruce Momjian <bruce@momjian.us>
Re: Run pgindent now? Alvaro Herrera <alvherre@2ndquadrant.com>
Re: Run pgindent now? Bruce Momjian <bruce@momjian.us>
Re: Run pgindent now? Alvaro Herrera <alvherre@2ndquadrant.com>
Re: Run pgindent now? Bruce Momjian <bruce@momjian.us>
Re: Run pgindent now? Tom Lane <tgl@sss.pgh.pa.us>
Re: Run pgindent now? Alvaro Herrera <alvherre@2ndquadrant.com>
Re: Run pgindent now? Tom Lane <tgl@sss.pgh.pa.us>
Re: Run pgindent now? Peter Eisentraut <peter_e@gmx.net>
Re: Run pgindent now? Bruce Momjian <bruce@momjian.us>
Re: Run pgindent now? Andres Freund <andres@anarazel.de>
Re: Run pgindent now? Bruce Momjian <bruce@momjian.us>
Re: Run pgindent now? Tom Lane <tgl@sss.pgh.pa.us>
Re: Run pgindent now? Peter Eisentraut <peter_e@gmx.net>
Re: Run pgindent now? Andres Freund <andres@anarazel.de>
Re: Run pgindent now? Bruce Momjian <bruce@momjian.us>
Re: Run pgindent now? Andrew Dunstan <andrew@dunslane.net>
Re: Run pgindent now? Peter Eisentraut <peter_e@gmx.net>
Re: Run pgindent now? Andres Freund <andres@anarazel.de>
Re: Run pgindent now? Peter Eisentraut <peter_e@gmx.net>
Re: Run pgindent now? Tom Lane <tgl@sss.pgh.pa.us>
Re: Run pgindent now? Peter Eisentraut <peter_e@gmx.net>
Re: Run pgindent now? Andrew Dunstan <andrew@dunslane.net>
Re: Run pgindent now? Andrew Dunstan <andrew@dunslane.net>
Re: Run pgindent now? Robert Haas <robertmhaas@gmail.com>
Re: Run pgindent now? Alvaro Herrera <alvherre@2ndquadrant.com>
Re: Run pgindent now? Andres Freund <andres@anarazel.de>
Re: Run pgindent now? Garick Hamlin <ghamlin@isc.upenn.edu>
Re: Run pgindent now? Tom Lane <tgl@sss.pgh.pa.us>
Re: Run pgindent now? Robert Haas <robertmhaas@gmail.com>
Re: Run pgindent now? Aidan Van Dyk <aidan@highrise.ca>
Re: Run pgindent now? Robert Haas <robertmhaas@gmail.com>
Re: Run pgindent now? Bruce Momjian <bruce@momjian.us>
Re: Run pgindent now? Andres Freund <andres@anarazel.de>
Re: Run pgindent now? Tom Lane <tgl@sss.pgh.pa.us>
Re: Run pgindent now? Alvaro Herrera <alvherre@2ndquadrant.com>
Re: Run pgindent now? Tom Lane <tgl@sss.pgh.pa.us>
Re: Run pgindent now? Alvaro Herrera <alvherre@2ndquadrant.com>
Re: Run pgindent now? Bruce Momjian <bruce@momjian.us>
Re: Run pgindent now? Andres Freund <andres@anarazel.de>
Re: Run pgindent now? Bruce Momjian <bruce@momjian.us>
Re: Run pgindent now? Alvaro Herrera <alvherre@2ndquadrant.com>
Re: Run pgindent now? Stephen Frost <sfrost@snowman.net>
On 5/25/15 7:15 PM, Andres Freund wrote:
> On 2015-05-25 19:01:28 -0400, Bruce Momjian wrote:
>>> A longer-term fix would be to make pgindent less stupid about this sort
>>> of usage, but nobody's yet volunteered to dig into the guts of that code.
>>
>> I assume a typedefs list is going to be a requirement of any decent C
>> indenting tool.
> 
> Maybe I'm missing something major here, but why? Afaict it's just only
> used for formatting decisions that could be made without it just as well?

AFAICT, the main reason is to decide whether * and & are binary infix or
unary prefix operators.  Otherwise, it wouldn't know whether to write
   char * foo;

or the more customary
   char *foo;

Now, running pgindent without a typedefs list also makes it do things like
static int32
-makepol(QPRS_STATE *state)
+makepol(QPRS_STATE * state)

which, one might argue, it could figure out without a typedefs list.
But then the formatting would be inconsistent between prototypes and
variable declarations, which might drive people crazy.  I don't know
whether there is a better way than living with it, one way or the other
(i.e., requiring a types list, or accepting slightly odd formatting).



В списке pgsql-hackers по дате отправления
От: Jeff Janes
Дата:
От: Andres Freund
Дата:
Сообщение: Re: Run pgindent now?
FAQ