Thread: perltidy

perltidy

From
Peter Eisentraut
Date:
How much do we care about applying perltidy, as described in
src/tools/msvc/README, everywhere?  I just ran it across the entire
tree, using

perltidy -b -bl -nsfs -naws -l=100 -ole=unix **/*.pl **/*.pm

and it generated 6531 lines of (unified) diff, of which 357 are in
src/tools/msvc/ itself.  So clearly it's not being applied very
consistently.

Given how easily this appears to work and how we're sneakily expanding
the use of Perl, I think we ought to add this to the standard pgindent
routine.




Re: perltidy

From
Bruce Momjian
Date:
Peter Eisentraut wrote:
> How much do we care about applying perltidy, as described in
> src/tools/msvc/README, everywhere?  I just ran it across the entire
> tree, using
> 
> perltidy -b -bl -nsfs -naws -l=100 -ole=unix **/*.pl **/*.pm
> 
> and it generated 6531 lines of (unified) diff, of which 357 are in
> src/tools/msvc/ itself.  So clearly it's not being applied very
> consistently.
> 
> Given how easily this appears to work and how we're sneakily expanding
> the use of Perl, I think we ought to add this to the standard pgindent
> routine.

Yes, I would support that.

--  Bruce Momjian  <bruce@momjian.us>        http://momjian.us EnterpriseDB
http://enterprisedb.com
 + It's impossible for everything to be true. +


Re: perltidy

From
Magnus Hagander
Date:
On Tue, Jun 14, 2011 at 21:39, Bruce Momjian <bruce@momjian.us> wrote:
> Peter Eisentraut wrote:
>> How much do we care about applying perltidy, as described in
>> src/tools/msvc/README, everywhere?  I just ran it across the entire
>> tree, using
>>
>> perltidy -b -bl -nsfs -naws -l=100 -ole=unix **/*.pl **/*.pm
>>
>> and it generated 6531 lines of (unified) diff, of which 357 are in
>> src/tools/msvc/ itself.  So clearly it's not being applied very
>> consistently.
>>
>> Given how easily this appears to work and how we're sneakily expanding
>> the use of Perl, I think we ought to add this to the standard pgindent
>> routine.
>
> Yes, I would support that.

I think I suggested that before at some point, but can't find the
reference. But that means, +1.


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


Re: perltidy

From
Bruce Momjian
Date:
Peter Eisentraut wrote:
> How much do we care about applying perltidy, as described in
> src/tools/msvc/README, everywhere?  I just ran it across the entire
> tree, using
>
> perltidy -b -bl -nsfs -naws -l=100 -ole=unix **/*.pl **/*.pm
>
> and it generated 6531 lines of (unified) diff, of which 357 are in
> src/tools/msvc/ itself.  So clearly it's not being applied very
> consistently.
>
> Given how easily this appears to work and how we're sneakily expanding
> the use of Perl, I think we ought to add this to the standard pgindent
> routine.

I have moved the Perl indentation command-line docs into the pgindent
README and it will be run as part of the pgindent checklist.  Applied
patch attached.

--
  Bruce Momjian  <bruce@momjian.us>        http://momjian.us
  EnterpriseDB                             http://enterprisedb.com

  + It's impossible for everything to be true. +
diff --git a/src/tools/msvc/README b/src/tools/msvc/README
new file mode 100644
index 58e266e..b8dd488
*** a/src/tools/msvc/README
--- b/src/tools/msvc/README
*************** the libpq frontend library. For more inf
*** 9,20 ****
  chapter "Installation on Windows".


- Notes about code indention
- --------------------------
- If the perl code is modified, use perltidy on it since pgindent won't
- touch perl code. Use the following commandline:
- perltidy -b -bl -nsfs -naws -l=100 -ole=unix *.pl *.pm
-
  Notes about Visual Studio Express
  ---------------------------------
  To build PostgreSQL using Visual Studio Express, the Platform SDK
--- 9,14 ----
diff --git a/src/tools/pgindent/README b/src/tools/pgindent/README
new file mode 100644
index 7504650..d88c201
*** a/src/tools/pgindent/README
--- b/src/tools/pgindent/README
*************** This can format all PostgreSQL *.c and *
*** 37,42 ****
--- 37,46 ----
      gmake -C contrib install
      gmake installcheck-world

+ 8) Indent the Perl MSVC code:
+
+     cd src/tools/msvc
+     perltidy -b -bl -nsfs -naws -l=100 -ole=unix *.pl *.pm

  ---------------------------------------------------------------------------