# 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
=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
=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
=head1 COPYRIGHT
-Copyright (c) 2000-2018 by Steve Hancock
+Copyright (c) 2000-2020 by Steve Hancock
=head1 LICENSE
<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>
<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>
<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>
<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>
<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>
# Release version must be bumped, and it is probably past time for a
# release anyway.
- $VERSION = '20191203.01';
+ $VERSION = '20200110';
}
sub streamhandle {
=head1 VERSION
-This man page documents Perl::Tidy version 20191203.01
+This man page documents Perl::Tidy version 20200110
=head1 LICENSE
package Perl::Tidy::Debugger;
use strict;
use warnings;
-our $VERSION = '20191203.01';
+our $VERSION = '20200110';
sub new {
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 }
package Perl::Tidy::Diagnostics;
use strict;
use warnings;
-our $VERSION = '20191203.01';
+our $VERSION = '20200110';
sub new {
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;
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()
package Perl::Tidy::HtmlWriter;
use strict;
use warnings;
-our $VERSION = '20191203.01';
+our $VERSION = '20200110';
use File::Basename;
use strict;
use warnings;
use Carp;
-our $VERSION = '20191203.01';
+our $VERSION = '20200110';
sub new {
my ( $package, $rscalar, $mode ) = @_;
use strict;
use warnings;
use Carp;
-our $VERSION = '20191203.01';
+our $VERSION = '20200110';
sub new {
my ( $package, $rarray, $mode ) = @_;
package Perl::Tidy::IndentationItem;
use strict;
use warnings;
-our $VERSION = '20191203.01';
+our $VERSION = '20200110';
sub new {
package Perl::Tidy::LineBuffer;
use strict;
use warnings;
-our $VERSION = '20191203.01';
+our $VERSION = '20200110';
sub new {
package Perl::Tidy::LineSink;
use strict;
use warnings;
-our $VERSION = '20191203.01';
+our $VERSION = '20200110';
sub new {
package Perl::Tidy::LineSource;
use strict;
use warnings;
-our $VERSION = '20191203.01';
+our $VERSION = '20200110';
sub new {
package Perl::Tidy::Logger;
use strict;
use warnings;
-our $VERSION = '20191203.01';
+our $VERSION = '20200110';
sub new {
package Perl::Tidy::Tokenizer;
use strict;
use warnings;
-our $VERSION = '20191203.01';
+our $VERSION = '20200110';
use Perl::Tidy::LineBuffer;
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;
package Perl::Tidy::VerticalAligner::Alignment;
use strict;
use warnings;
-our $VERSION = '20191203.01';
+our $VERSION = '20200110';
{
package Perl::Tidy::VerticalAligner::Line;
use strict;
use warnings;
-our $VERSION = '20191203.01';
+our $VERSION = '20200110';
{