Re: [COMMITTERS] pgsql: Run pgindent on 9.2 source tree in preparation for first 9.3

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Noah Misch <noah(at)leadboat(dot)com>
Cc: Alvaro Herrera <alvherre(at)commandprompt(dot)com>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [COMMITTERS] pgsql: Run pgindent on 9.2 source tree in preparation for first 9.3
Date: 2012-06-16 14:15:10
Message-ID: 20120616141510.GE26006@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers pgsql-hackers

On Sat, Jun 16, 2012 at 01:10:31AM -0400, Noah Misch wrote:
> On Fri, Jun 15, 2012 at 10:45:16PM -0400, Bruce Momjian wrote:
> > I have updated the pgindent README to use
> > these Perl indent instructions:
> >
> > find . -name \*.pl -o -name \*.pm | xargs perltidy \
> > --backup-and-modify-in-place --opening-brace-on-new-line \
> > --vertical-tightness=2 --vertical-tightness-closing=2 \
> > --nospace-after-keyword=for --nospace-for-semicolon \
> > --add-whitespace --delete-old-whitespace --paren-tightness=2 \
> > --keep-old-blank-lines=2 --maximum-line-length=78 \
> > --entab-leading-whitespace=4 --output-line-ending=unix
>
> I would lean against using --nospace-after-keyword=for. Not using it means we
> get wrong formatting when the for-loop conditions span multiple lines. Using
> it means we get wrong formatting (albeit less severe) on every for-loop. In
> any event, if we do use it for for-loops, we should probably use it for all
> control structure keywords.

Agreed, good point.

> Otherwise, I like this.
>
> As a last idle idea, how about putting the options in a configuration file and
> passing --profile= as the only option? Besides keeping you from copying a
> 7-line shell command, this has the benefit of ignoring any ~/.perltidyrc.

Also agreed, and change made. Perltidyrc now has:

--add-whitespace
--backup-and-modify-in-place
--delete-old-whitespace
--entab-leading-whitespace=4
--keep-old-blank-lines=2
--maximum-line-length=78
--nospace-for-semicolon
--opening-brace-on-new-line
--output-line-ending=unix
--paren-tightness=2
--vertical-tightness=2
--vertical-tightness-closing=2

--
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://enterprisedb.com

+ It's impossible for everything to be true. +

In response to

Browse pgsql-committers by date

  From Date Subject
Next Message Magnus Hagander 2012-06-17 13:24:29 pgsql: Add missing subtitle for compressed archive logs
Previous Message Bruce Momjian 2012-06-16 14:13:03 pgsql: Remove 'for' loop perltidy argument, and move args to perltidyrc

Browse pgsql-hackers by date

  From Date Subject
Next Message Marko Kreen 2012-06-16 14:22:46 Re: [patch] libpq one-row-at-a-time API
Previous Message Dean Rasheed 2012-06-16 13:50:30 REVIEW: Optimize referential integrity checks (todo item)