perltidy

Lists: pgsql-hackers
From: Magnus Hagander <magnus(at)hagander(dot)net>
To: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: perltidy
Date: 2010-04-19 15:02:10
Message-ID: z2g9837222c1004190802je7648c5ekc72c359cd1c1e30e@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

The MSVC scripts currently have a "perltidy coding style" so we run
perltidy with a specific set of arguments to format the code. (This is
in the README). Kind of like pgindent.

Should we be doing this on all the perlscripts we use?

And if we do, we should obviously use the same one everywhere -
probably just use the one we have for the msvc stuff today. Anything
in particular about that one that people hate?

--
Magnus Hagander
Me: http://www.hagander.net/
Work: http://www.redpill-linpro.com/


From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Magnus Hagander <magnus(at)hagander(dot)net>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: perltidy
Date: 2010-04-19 16:02:07
Message-ID: 4BCC7E7F.80703@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Magnus Hagander wrote:
> The MSVC scripts currently have a "perltidy coding style" so we run
> perltidy with a specific set of arguments to format the code. (This is
> in the README). Kind of like pgindent.
>
> Should we be doing this on all the perlscripts we use?
>
> And if we do, we should obviously use the same one everywhere -
> probably just use the one we have for the msvc stuff today. Anything
> in particular about that one that people hate?
>
>

It's been debated in the past. My personal strong conviction (probably
fuelled in part by my severe dislike of K&R style indentation) is that
we should have a single style for block structured languages across the
project.

cheers

andrew


From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: Magnus Hagander <magnus(at)hagander(dot)net>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: perltidy
Date: 2010-04-19 16:24:21
Message-ID: 1271694261.14012.2.camel@vanquo.pezone.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On mån, 2010-04-19 at 17:02 +0200, Magnus Hagander wrote:
> The MSVC scripts currently have a "perltidy coding style" so we run
> perltidy with a specific set of arguments to format the code. (This is
> in the README). Kind of like pgindent.
>
> Should we be doing this on all the perlscripts we use?
>
> And if we do, we should obviously use the same one everywhere -
> probably just use the one we have for the msvc stuff today. Anything
> in particular about that one that people hate?

I tried it on create_help.pl and couldn't find a good combination of
options that I liked. It either adds too much whitespace or removes too
much, or both. Maybe that can be fined tuned. I wouldn't want to use
the -bl option; it's not a typical Perl style.


From: Magnus Hagander <magnus(at)hagander(dot)net>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: perltidy
Date: 2010-04-19 16:31:00
Message-ID: i2o9837222c1004190931t66323f53l8370ac3645ebe2d5@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Mon, Apr 19, 2010 at 18:24, Peter Eisentraut <peter_e(at)gmx(dot)net> wrote:
> On mån, 2010-04-19 at 17:02 +0200, Magnus Hagander wrote:
>> The MSVC scripts currently have a "perltidy coding style" so we run
>> perltidy with a specific set of arguments to format the code. (This is
>> in the README). Kind of like pgindent.
>>
>> Should we be doing this on all the perlscripts we use?
>>
>> And if we do, we should obviously use the same one everywhere -
>> probably just use the one we have for the msvc stuff today. Anything
>> in particular about that one that people hate?
>
> I tried it on create_help.pl and couldn't find a good combination of
> options that I liked.  It either adds too much whitespace or removes too
> much, or both.  Maybe that can be fined tuned.  I wouldn't want to use
> the -bl option; it's not a typical Perl style.

I doubt we're ever going to find a style taht everybody likes. Heck,
everybody certainly don't like our C style. We just need to decide on
one that's good enough and then go with it.

I don't recall exactly why -bl was added to the msvc style, but
probably to make it look more like our C code ;)

I don't care too much exactly *what* we do, but I think we should have
a common style...

--
Magnus Hagander
Me: http://www.hagander.net/
Work: http://www.redpill-linpro.com/


From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Magnus Hagander <magnus(at)hagander(dot)net>
Cc: Peter Eisentraut <peter_e(at)gmx(dot)net>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: perltidy
Date: 2010-04-20 16:24:21
Message-ID: 201004201624.o3KGOLa02746@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Magnus Hagander wrote:
> On Mon, Apr 19, 2010 at 18:24, Peter Eisentraut <peter_e(at)gmx(dot)net> wrote:
> > On m?n, 2010-04-19 at 17:02 +0200, Magnus Hagander wrote:
> >> The MSVC scripts currently have a "perltidy coding style" so we run
> >> perltidy with a specific set of arguments to format the code. (This is
> >> in the README). Kind of like pgindent.
> >>
> >> Should we be doing this on all the perlscripts we use?
> >>
> >> And if we do, we should obviously use the same one everywhere -
> >> probably just use the one we have for the msvc stuff today. Anything
> >> in particular about that one that people hate?
> >
> > I tried it on create_help.pl and couldn't find a good combination of
> > options that I liked. ?It either adds too much whitespace or removes too
> > much, or both. ?Maybe that can be fined tuned. ?I wouldn't want to use
> > the -bl option; it's not a typical Perl style.
>
> I doubt we're ever going to find a style taht everybody likes. Heck,
> everybody certainly don't like our C style. We just need to decide on
> one that's good enough and then go with it.
>
> I don't recall exactly why -bl was added to the msvc style, but
> probably to make it look more like our C code ;)
>
> I don't care too much exactly *what* we do, but I think we should have
> a common style...

Agreed. We used to do this for Java when we had jdbc included.

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