Re: pg_get_viewdefs() indentation considered harmful

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Greg Stark <stark(at)mit(dot)edu>
Cc: Bruce Momjian <bruce(at)momjian(dot)us>, Andrew Dunstan <andrew(at)dunslane(dot)net>, Robert Haas <robertmhaas(at)gmail(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: pg_get_viewdefs() indentation considered harmful
Date: 2014-04-30 00:05:44
Message-ID: 5197.1398816344@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Greg Stark <stark(at)mit(dot)edu> writes:
> Actually the only thing that might want to be adjusted is the
> indentation in the beginning of the setop (ruleutils.c:4720) which is
> what causes that long line of parentheses at the beginning of the
> example. I suppose in an ideal world it would start following the
> reduced spacing and wrap to new lines whenever the indentation goes
> back to the left. But I can't get too excited by it in the example and
> I'm not sure it's even intended to line up anyways. It just inserts
> STD spaces without a newline.

Actually, the patch I posted a little bit ago gets rid of that. However,
I'm still dubious about halving the step distance, because there are
assorted places that adjust the indentation of specific keywords by
distances that aren't a multiple of 2 (look for odd last arguments to
appendContextKeyword). I'm not sure how that will look after we make such
a change. Possibly it would work to only apply the scale factor to
context->indentLevel, and not the indentPlus number?

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Kapila 2014-04-30 04:39:42 Re: Fix initdb for path with whitespace and at char
Previous Message Greg Stark 2014-04-29 23:49:24 Re: pg_get_viewdefs() indentation considered harmful