Re: [HACKERS] perltidy
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 br...@momjian.ushttp://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 --- -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers
[HACKERS] perltidy
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. -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers
Re: [HACKERS] perltidy
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 br...@momjian.ushttp://momjian.us EnterpriseDB http://enterprisedb.com + It's impossible for everything to be true. + -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers
Re: [HACKERS] perltidy
On Tue, Jun 14, 2011 at 21:39, Bruce Momjian br...@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/ -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers
Re: [HACKERS] perltidy
Magnus Hagander wrote: On Mon, Apr 19, 2010 at 18:24, Peter Eisentraut pete...@gmx.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 br...@momjian.ushttp://momjian.us EnterpriseDB http://enterprisedb.com -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers
[HACKERS] perltidy
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/ -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers
Re: [HACKERS] perltidy
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 KR style indentation) is that we should have a single style for block structured languages across the project. cheers andrew -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers
Re: [HACKERS] perltidy
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. -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers
Re: [HACKERS] perltidy
On Mon, Apr 19, 2010 at 18:24, Peter Eisentraut pete...@gmx.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/ -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers