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

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема Re: [COMMITTERS] pgsql: Run pgindent on 9.2 source tree in preparation for first 9.3
Дата
Msg-id 1339451098-sup-8884@alvh.no-ip.org
обсуждение исходный текст
Ответ на Re: [COMMITTERS] pgsql: Run pgindent on 9.2 source tree in preparation for first 9.3  (Bruce Momjian <bruce@momjian.us>)
Ответы Re: [COMMITTERS] pgsql: Run pgindent on 9.2 source tree in preparation for first 9.3  (Robert Haas <robertmhaas@gmail.com>)
Re: [COMMITTERS] pgsql: Run pgindent on 9.2 source tree in preparation for first 9.3  (Bruce Momjian <bruce@momjian.us>)
Re: [COMMITTERS] pgsql: Run pgindent on 9.2 source tree in preparation for first 9.3  (Noah Misch <noah@leadboat.com>)
Список pgsql-hackers
Excerpts from Bruce Momjian's message of lun jun 11 15:44:16 -0400 2012:
>
> On Mon, Jun 11, 2012 at 12:20:13PM -0400, Alvaro Herrera wrote:
> > > > Hm, does this touch stuff that would also be modified by perltidy?  I
> > > > wonder if we should refrain from doing entab/detab on perl files and
> > > > instead have perltidy touch such code.
> >
> > > The Perl files were modified by perltidy and not by pgindent, as
> > > documented in the pgindent README:
> > >
> > >     9) Indent the Perl MSVC code:
> > >
> > >             cd src/tools/msvc
> > >             perltidy -b -bl -nsfs -naws -l=100 -ole=unix *.pl *.pm
> >
> > Oh, I see.  That's great then.  Should those change be committed
> > separately, just to avoid confusion?  BTW those aren't the only Perl
>
> Not sure.  I just followed the README instructions.  I should just
> probably mention the Perl files were not processed by pgindent on the
> commit.

Well, you wrote the instructions yourself :-)

> > files in the source tree -- we also have the genbki stuff, for example.
> > (There is already some inconsistency in tabs/spaces in genbki.pl
> > already)
>
> I was not aware of them.  If you want them run, would you update the
> pgindent README to mention them please?

What about something like this in the root of the tree:
find . -name \*.pl -o -name \*.pm | xargs perltidy -b -bl -nsfs -naws -l=100 -ole=unix

There are files all over the place.  The file that would most be
affected with one run of this is the ECPG grammar generator.

I checked the "-et=4" business (which is basically entab).  We're pretty
inconsistent about tabs in perl code it seems; some files use tabs
others use spaces.  Honestly I would just settle on what we use on C
files, even if the Perl devs don't recommend it "because of
maintainability and portability".  I mean if it works well for us for C
code, why would it be a problem in Perl code?  However, I don't write
much of that Perl code myself.

> > > > Perhaps the thing to do is ensure that perltidy also uses tabs instead
> > > > of spaces.
> > >
> > > If you would like 'entab' run on the Perl files, let me know.
> >
> > Whatever perltidy emits is fine with me, but should we consider passing
> > -et=4 to perltidy?
>
> No idea.  I do not work in those files enough to have an opinion.

What do others think?  Maybe I'm just being obnoxious here for no useful
gain.

--
Álvaro Herrera <alvherre@commandprompt.com>
The PostgreSQL Company - Command Prompt, Inc.
PostgreSQL Replication, Consulting, Custom Development, 24x7 support


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

Предыдущее
От: Peter Eisentraut
Дата:
Сообщение: Re: Ability to listen on two unix sockets
Следующее
От: Robert Haas
Дата:
Сообщение: Re: [COMMITTERS] pgsql: Run pgindent on 9.2 source tree in preparation for first 9.3