From aca7b29e00cdc0461ed3872fb8d4ecbbbed1fb14 Mon Sep 17 00:00:00 2001 From: Steve Hancock <perltidy@users.sourceforge.net> Date: Tue, 7 Jan 2020 08:38:35 -0800 Subject: [PATCH] prepare for release of VERSION 20200110 --- CHANGES.md | 37 +++++++++++++++------- bin/perltidy | 32 ++++++++++--------- docs/ChangeLog.html | 37 +++++++++++++++------- docs/Tidy.html | 2 +- docs/perltidy.html | 25 ++++++++------- lib/Perl/Tidy.pm | 2 +- lib/Perl/Tidy.pod | 2 +- lib/Perl/Tidy/Debugger.pm | 2 +- lib/Perl/Tidy/DevNull.pm | 2 +- lib/Perl/Tidy/Diagnostics.pm | 2 +- lib/Perl/Tidy/FileWriter.pm | 2 +- lib/Perl/Tidy/Formatter.pm | 2 +- lib/Perl/Tidy/HtmlWriter.pm | 2 +- lib/Perl/Tidy/IOScalar.pm | 2 +- lib/Perl/Tidy/IOScalarArray.pm | 2 +- lib/Perl/Tidy/IndentationItem.pm | 2 +- lib/Perl/Tidy/LineBuffer.pm | 2 +- lib/Perl/Tidy/LineSink.pm | 2 +- lib/Perl/Tidy/LineSource.pm | 2 +- lib/Perl/Tidy/Logger.pm | 2 +- lib/Perl/Tidy/Tokenizer.pm | 2 +- lib/Perl/Tidy/VerticalAligner.pm | 2 +- lib/Perl/Tidy/VerticalAligner/Alignment.pm | 2 +- lib/Perl/Tidy/VerticalAligner/Line.pm | 2 +- 24 files changed, 100 insertions(+), 71 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index d65ea3e9..953953c8 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,23 +1,36 @@ # Perltidy Change Log -## 2019 12 03.01 +## 2020 01 10 - - Added a flag to control the feature RT#130394, allow short nested blocks, - introduced in the previous release. This feature breaks existing RPerl - installations, so a control flag has been introduced and the feature is + - This release adds a flag to control the feature RT#130394 (allow short nested blocks) + introduced in the previous release. Unfortunately that feature breaks existing + RPerl installations, so a control flag has been introduced and that feature is now off by default. The flag is: - --one-line-block-nesting=i, or -olbn=i, where: + --one-line-block-nesting=n, or -olbn=n, where n is an integer as follows: - -olbn=0 do not allow nested one-line blocks [DEFAULT] - -olbn=1 allow nested-one line blocks + -olbn=0 break nested one-line blocks into multiple lines [new DEFAULT] + -olbn=1 stable; keep existing nested-one line blocks intact - - Fixed issue RT#131288: parse error for un-prototyped constant function - followed by ternary. + For example, consider this input line: - - Fixed issue RT#131360, installation documentation. Metacpan generates - instructions for the perltidy binary which are incorrect. The binary - comes with Perl::Tidy. They can both be installed with 'cpanm Perl::Tidy' + foreach (@list) { if ($_ eq $asked_for) { last } ++$found } + + The default behavior (-olbn=0) is to break it into multiple lines: + + foreach (@list) { + if ( $_ eq $asked_for ) { last } + ++$found; + } + + To keep nested one-line blocks like this on a single line you can add the parameter -olbn=1. + + - Fixed issue RT#131288: parse error for un-prototyped constant function without parenthesized + call parameters followed by ternary. + + - Fixed issue RT#131360, installation documentation. Added a note that the binary + 'perltidy' comes with the Perl::Tidy module. They can both normally be installed with + 'cpanm Perl::Tidy' ## 2019 12 03 diff --git a/bin/perltidy b/bin/perltidy index e3bd70d1..2ee131f3 100755 --- a/bin/perltidy +++ b/bin/perltidy @@ -3105,25 +3105,27 @@ semicolon. So these two options are not exact inverses. =item B<-olbn=n>, B<--one-line-block-nesting=n> -One-line blocks which themselves contain code blocks will normally be broken -into multiple lines. This behavior can be controlled with this flag. The -values of n are: +Nested one-line blocks are lines with code blocks which themselves contain code +blocks. For example, the following line is a nested one-line block. - n=0 do not allow nested one-line blocks [DEFAULT] - n=1 stable: keep existing nested-one line blocks + foreach (@list) { if ($_ eq $asked_for) { last } ++$found } -For example, given the following line: +The default behavior is to break such lines into multiple lines, but this +behavior can be controlled with this flag. The values of n are: - sub nospacesplit { map { /^\s*$/ ? () : $_ } split $_[0], $_[1] } + n=0 break nested one-line blocks into multiple lines [DEFAULT] + n=1 stable: keep existing nested-one line blocks intact +For the above example, the default formatting (B<-olbn=0>) is -the default behavior (B<-olbn=0>) is to break it into multiple lines: - - sub nospacesplit { - map { /^\s*$/ ? () : $_ } split $_[0], $_[1]; + foreach (@list) { + if ( $_ eq $asked_for ) { last } + ++$found; } -The line will be left intact with B<-olbn=1>. +If the parameter B<-olbn=1> is given, then the line will be left intact if it +is a single line in the source, or it will be broken into multiple lines if it +is broken in multiple lines in the source. =back @@ -3829,11 +3831,11 @@ perlstyle(1), Perl::Tidy(3) =head1 INSTALLATION -The perltidy binary uses the Perl::Tidy module and is installed when that module is installed. On many systems, the command 'cpanm Perl::Tidy' will install them. +The perltidy binary uses the Perl::Tidy module and is installed when that module is installed. Module installation is system-dependent. On some systems, the command 'cpanm Perl::Tidy' will work. =head1 VERSION -This man page documents perltidy version 20191203.01 +This man page documents perltidy version 20200110 =head1 BUG REPORTS @@ -3845,7 +3847,7 @@ The source code repository is at L<https://github.com/perltidy/perltidy>. =head1 COPYRIGHT -Copyright (c) 2000-2018 by Steve Hancock +Copyright (c) 2000-2020 by Steve Hancock =head1 LICENSE diff --git a/docs/ChangeLog.html b/docs/ChangeLog.html index a9971b38..11c757ee 100644 --- a/docs/ChangeLog.html +++ b/docs/ChangeLog.html @@ -1,23 +1,36 @@ <h1>Perltidy Change Log</h1> -<h2>2019 12 03.01</h2> +<h2>2020 01 10</h2> -<pre><code>- Added a flag to control the feature RT#130394, allow short nested blocks, - introduced in the previous release. This feature breaks existing RPerl - installations, so a control flag has been introduced and the feature is +<pre><code>- This release adds a flag to control the feature RT#130394 (allow short nested blocks) + introduced in the previous release. Unfortunately that feature breaks existing + RPerl installations, so a control flag has been introduced and that feature is now off by default. The flag is: - --one-line-block-nesting=i, or -olbn=i, where: + --one-line-block-nesting=n, or -olbn=n, where n is an integer as follows: - -olbn=0 do not allow nested one-line blocks [DEFAULT] - -olbn=1 allow nested-one line blocks + -olbn=0 break nested one-line blocks into multiple lines [new DEFAULT] + -olbn=1 stable; keep existing nested-one line blocks intact -- Fixed issue RT#131288: parse error for un-prototyped constant function - followed by ternary. + For example, consider this input line: -- Fixed issue RT#131360, installation documentation. Metacpan generates - instructions for the perltidy binary which are incorrect. The binary - comes with Perl::Tidy. They can both be installed with 'cpanm Perl::Tidy' + foreach (@list) { if ($_ eq $asked_for) { last } ++$found } + + The default behavior (-olbn=0) is to break it into multiple lines: + + foreach (@list) { + if ( $_ eq $asked_for ) { last } + ++$found; + } + + To keep nested one-line blocks like this on a single line you can add the parameter -olbn=1. + +- Fixed issue RT#131288: parse error for un-prototyped constant function without parenthesized + call parameters followed by ternary. + +- Fixed issue RT#131360, installation documentation. Added a note that the binary + 'perltidy' comes with the Perl::Tidy module. They can both normally be installed with + 'cpanm Perl::Tidy' </code></pre> <h2>2019 12 03</h2> diff --git a/docs/Tidy.html b/docs/Tidy.html index 93fc0155..ee5cd674 100644 --- a/docs/Tidy.html +++ b/docs/Tidy.html @@ -358,7 +358,7 @@ <h1 id="VERSION">VERSION</h1> -<p>This man page documents Perl::Tidy version 20191203.01</p> +<p>This man page documents Perl::Tidy version 20200110</p> <h1 id="LICENSE">LICENSE</h1> diff --git a/docs/perltidy.html b/docs/perltidy.html index 8edae50b..599c38de 100644 --- a/docs/perltidy.html +++ b/docs/perltidy.html @@ -2445,22 +2445,23 @@ <dt id="olbn-n---one-line-block-nesting-n"><b>-olbn=n</b>, <b>--one-line-block-nesting=n</b></dt> <dd> -<p>One-line blocks which themselves contain code blocks will normally be broken into multiple lines. This behavior can be controlled with this flag. The values of n are:</p> +<p>Nested one-line blocks are lines with code blocks which themselves contain code blocks. For example, the following line is a nested one-line block.</p> -<pre><code> n=0 do not allow nested one-line blocks [DEFAULT] - n=1 stable: keep existing nested-one line blocks</code></pre> +<pre><code> foreach (@list) { if ($_ eq $asked_for) { last } ++$found }</code></pre> -<p>For example, given the following line:</p> +<p>The default behavior is to break such lines into multiple lines, but this behavior can be controlled with this flag. The values of n are:</p> -<pre><code> sub nospacesplit { map { /^\s*$/ ? () : $_ } split $_[0], $_[1] }</code></pre> +<pre><code> n=0 break nested one-line blocks into multiple lines [DEFAULT] + n=1 stable: keep existing nested-one line blocks intact</code></pre> -<p>the default behavior (<b>-olbn=0</b>) is to break it into multiple lines:</p> +<p>For the above example, the default formatting (<b>-olbn=0</b>) is</p> -<pre><code> sub nospacesplit { - map { /^\s*$/ ? () : $_ } split $_[0], $_[1]; +<pre><code> foreach (@list) { + if ( $_ eq $asked_for ) { last } + ++$found; }</code></pre> -<p>The line will be left intact with <b>-olbn=1</b>.</p> +<p>If the parameter <b>-olbn=1</b> is given, then the line will be left intact if it is a single line in the source, or it will be broken into multiple lines if it is broken in multiple lines in the source.</p> </dd> </dl> @@ -2952,11 +2953,11 @@ <h1 id="INSTALLATION">INSTALLATION</h1> -<p>The perltidy binary uses the Perl::Tidy module and is installed when that module is installed. On many systems, the command 'cpanm Perl::Tidy' will install them.</p> +<p>The perltidy binary uses the Perl::Tidy module and is installed when that module is installed. Module installation is system-dependent. On some systems, the command 'cpanm Perl::Tidy' will work.</p> <h1 id="VERSION">VERSION</h1> -<p>This man page documents perltidy version 20191203.01</p> +<p>This man page documents perltidy version 20200110</p> <h1 id="BUG-REPORTS">BUG REPORTS</h1> @@ -2968,7 +2969,7 @@ <h1 id="COPYRIGHT">COPYRIGHT</h1> -<p>Copyright (c) 2000-2018 by Steve Hancock</p> +<p>Copyright (c) 2000-2020 by Steve Hancock</p> <h1 id="LICENSE">LICENSE</h1> diff --git a/lib/Perl/Tidy.pm b/lib/Perl/Tidy.pm index 05dcebb9..b30410ec 100644 --- a/lib/Perl/Tidy.pm +++ b/lib/Perl/Tidy.pm @@ -110,7 +110,7 @@ BEGIN { # Release version must be bumped, and it is probably past time for a # release anyway. - $VERSION = '20191203.01'; + $VERSION = '20200110'; } sub streamhandle { diff --git a/lib/Perl/Tidy.pod b/lib/Perl/Tidy.pod index a98ba8dd..9307ca0f 100644 --- a/lib/Perl/Tidy.pod +++ b/lib/Perl/Tidy.pod @@ -419,7 +419,7 @@ On many systems, the command 'cpanm Perl::Tidy' will install both the module Per =head1 VERSION -This man page documents Perl::Tidy version 20191203.01 +This man page documents Perl::Tidy version 20200110 =head1 LICENSE diff --git a/lib/Perl/Tidy/Debugger.pm b/lib/Perl/Tidy/Debugger.pm index 74c035fb..09b82855 100644 --- a/lib/Perl/Tidy/Debugger.pm +++ b/lib/Perl/Tidy/Debugger.pm @@ -7,7 +7,7 @@ package Perl::Tidy::Debugger; use strict; use warnings; -our $VERSION = '20191203.01'; +our $VERSION = '20200110'; sub new { diff --git a/lib/Perl/Tidy/DevNull.pm b/lib/Perl/Tidy/DevNull.pm index df4c199e..42e09d0d 100644 --- a/lib/Perl/Tidy/DevNull.pm +++ b/lib/Perl/Tidy/DevNull.pm @@ -7,7 +7,7 @@ package Perl::Tidy::DevNull; use strict; use warnings; -our $VERSION = '20191203.01'; +our $VERSION = '20200110'; sub new { my $self = shift; return bless {}, $self } sub print { return } sub close { return } diff --git a/lib/Perl/Tidy/Diagnostics.pm b/lib/Perl/Tidy/Diagnostics.pm index cb27ec2d..1893f1c9 100644 --- a/lib/Perl/Tidy/Diagnostics.pm +++ b/lib/Perl/Tidy/Diagnostics.pm @@ -20,7 +20,7 @@ package Perl::Tidy::Diagnostics; use strict; use warnings; -our $VERSION = '20191203.01'; +our $VERSION = '20200110'; sub new { diff --git a/lib/Perl/Tidy/FileWriter.pm b/lib/Perl/Tidy/FileWriter.pm index 91e2447a..c598e1e8 100644 --- a/lib/Perl/Tidy/FileWriter.pm +++ b/lib/Perl/Tidy/FileWriter.pm @@ -7,7 +7,7 @@ package Perl::Tidy::FileWriter; use strict; use warnings; -our $VERSION = '20191203.01'; +our $VERSION = '20200110'; # Maximum number of little messages; probably need not be changed. my $MAX_NAG_MESSAGES = 6; diff --git a/lib/Perl/Tidy/Formatter.pm b/lib/Perl/Tidy/Formatter.pm index 3519412e..164ca459 100644 --- a/lib/Perl/Tidy/Formatter.pm +++ b/lib/Perl/Tidy/Formatter.pm @@ -12,7 +12,7 @@ package Perl::Tidy::Formatter; use strict; use warnings; use Carp; -our $VERSION = '20191203.01'; +our $VERSION = '20200110'; # The Tokenizer will be loaded with the Formatter ##use Perl::Tidy::Tokenizer; # for is_keyword() diff --git a/lib/Perl/Tidy/HtmlWriter.pm b/lib/Perl/Tidy/HtmlWriter.pm index fb095289..24e8b695 100644 --- a/lib/Perl/Tidy/HtmlWriter.pm +++ b/lib/Perl/Tidy/HtmlWriter.pm @@ -7,7 +7,7 @@ package Perl::Tidy::HtmlWriter; use strict; use warnings; -our $VERSION = '20191203.01'; +our $VERSION = '20200110'; use File::Basename; diff --git a/lib/Perl/Tidy/IOScalar.pm b/lib/Perl/Tidy/IOScalar.pm index 5951ef7f..3d701443 100644 --- a/lib/Perl/Tidy/IOScalar.pm +++ b/lib/Perl/Tidy/IOScalar.pm @@ -10,7 +10,7 @@ package Perl::Tidy::IOScalar; use strict; use warnings; use Carp; -our $VERSION = '20191203.01'; +our $VERSION = '20200110'; sub new { my ( $package, $rscalar, $mode ) = @_; diff --git a/lib/Perl/Tidy/IOScalarArray.pm b/lib/Perl/Tidy/IOScalarArray.pm index d73bb45b..17686eb6 100644 --- a/lib/Perl/Tidy/IOScalarArray.pm +++ b/lib/Perl/Tidy/IOScalarArray.pm @@ -14,7 +14,7 @@ package Perl::Tidy::IOScalarArray; use strict; use warnings; use Carp; -our $VERSION = '20191203.01'; +our $VERSION = '20200110'; sub new { my ( $package, $rarray, $mode ) = @_; diff --git a/lib/Perl/Tidy/IndentationItem.pm b/lib/Perl/Tidy/IndentationItem.pm index 0db00713..7a6c1006 100644 --- a/lib/Perl/Tidy/IndentationItem.pm +++ b/lib/Perl/Tidy/IndentationItem.pm @@ -8,7 +8,7 @@ package Perl::Tidy::IndentationItem; use strict; use warnings; -our $VERSION = '20191203.01'; +our $VERSION = '20200110'; sub new { diff --git a/lib/Perl/Tidy/LineBuffer.pm b/lib/Perl/Tidy/LineBuffer.pm index 450a0774..66e2858e 100644 --- a/lib/Perl/Tidy/LineBuffer.pm +++ b/lib/Perl/Tidy/LineBuffer.pm @@ -12,7 +12,7 @@ package Perl::Tidy::LineBuffer; use strict; use warnings; -our $VERSION = '20191203.01'; +our $VERSION = '20200110'; sub new { diff --git a/lib/Perl/Tidy/LineSink.pm b/lib/Perl/Tidy/LineSink.pm index dd6962e5..51a68268 100644 --- a/lib/Perl/Tidy/LineSink.pm +++ b/lib/Perl/Tidy/LineSink.pm @@ -8,7 +8,7 @@ package Perl::Tidy::LineSink; use strict; use warnings; -our $VERSION = '20191203.01'; +our $VERSION = '20200110'; sub new { diff --git a/lib/Perl/Tidy/LineSource.pm b/lib/Perl/Tidy/LineSource.pm index f109b387..d11144d9 100644 --- a/lib/Perl/Tidy/LineSource.pm +++ b/lib/Perl/Tidy/LineSource.pm @@ -8,7 +8,7 @@ package Perl::Tidy::LineSource; use strict; use warnings; -our $VERSION = '20191203.01'; +our $VERSION = '20200110'; sub new { diff --git a/lib/Perl/Tidy/Logger.pm b/lib/Perl/Tidy/Logger.pm index 2b80c8ec..cab937b3 100644 --- a/lib/Perl/Tidy/Logger.pm +++ b/lib/Perl/Tidy/Logger.pm @@ -7,7 +7,7 @@ package Perl::Tidy::Logger; use strict; use warnings; -our $VERSION = '20191203.01'; +our $VERSION = '20200110'; sub new { diff --git a/lib/Perl/Tidy/Tokenizer.pm b/lib/Perl/Tidy/Tokenizer.pm index 579078dd..e1d644a9 100644 --- a/lib/Perl/Tidy/Tokenizer.pm +++ b/lib/Perl/Tidy/Tokenizer.pm @@ -21,7 +21,7 @@ package Perl::Tidy::Tokenizer; use strict; use warnings; -our $VERSION = '20191203.01'; +our $VERSION = '20200110'; use Perl::Tidy::LineBuffer; diff --git a/lib/Perl/Tidy/VerticalAligner.pm b/lib/Perl/Tidy/VerticalAligner.pm index 561d6a6b..7efabb58 100644 --- a/lib/Perl/Tidy/VerticalAligner.pm +++ b/lib/Perl/Tidy/VerticalAligner.pm @@ -1,7 +1,7 @@ package Perl::Tidy::VerticalAligner; use strict; use warnings; -our $VERSION = '20191203.01'; +our $VERSION = '20200110'; use Perl::Tidy::VerticalAligner::Alignment; use Perl::Tidy::VerticalAligner::Line; diff --git a/lib/Perl/Tidy/VerticalAligner/Alignment.pm b/lib/Perl/Tidy/VerticalAligner/Alignment.pm index 96f152a5..8a2c5c6d 100644 --- a/lib/Perl/Tidy/VerticalAligner/Alignment.pm +++ b/lib/Perl/Tidy/VerticalAligner/Alignment.pm @@ -7,7 +7,7 @@ package Perl::Tidy::VerticalAligner::Alignment; use strict; use warnings; -our $VERSION = '20191203.01'; +our $VERSION = '20200110'; { diff --git a/lib/Perl/Tidy/VerticalAligner/Line.pm b/lib/Perl/Tidy/VerticalAligner/Line.pm index 6e938fc4..c5992694 100644 --- a/lib/Perl/Tidy/VerticalAligner/Line.pm +++ b/lib/Perl/Tidy/VerticalAligner/Line.pm @@ -8,7 +8,7 @@ package Perl::Tidy::VerticalAligner::Line; use strict; use warnings; -our $VERSION = '20191203.01'; +our $VERSION = '20200110'; { -- 2.39.5