# Perltidy Change Log
-## 2024 02 02.02
+## 2024 02 02.03
- Add option --valign-wide-equals, or -vwe, for issue git #135.
Setting this parameter causes the following assignment operators
= **= += *= &= <<= &&= -= /= |= >>= ||= //= .= %= ^= x=
to be aligned vertically with the ending = all aligned. For example,
- here is the default formatting of a snippet from perltidy itself:
+ here is the default formatting of a snippet of code:
$str .= SPACE x $total_pad_count;
$str_len += $total_pad_count;
$str .= $rfields->[$j];
$str_len += $rfield_lengths->[$j];
- And here is the same code formatted with B<-vme>:
+ And here is the same code formatted with -vwe:
- # perltidy -vme
+ # perltidy -vwe
$str .= SPACE x $total_pad_count;
$str_len += $total_pad_count;
$total_pad_count = 0;
$str .= $rfields->[$j];
$str_len += $rfield_lengths->[$j];
- This option is off by default to avoid changing existing formatting.
+ This option currently is off by default to avoid changing existing formatting.
- In the option --dump-block-summary, the number of sub arguments indicated
for each sub now includes any leading object variable passed with
=head1 VERSION
-This man page documents perltidy version 20240202.02
+This man page documents perltidy version 20240202.03
=head1 BUG REPORTS
$titles
.= ( $timestamp
? format_date($timestamp)
- : "" )
- . ";";
+ : "" ) . ";";
# S2
$titles
.= ( $timestamp
? format_date($timestamp)
- : "" )
- . ";";
+ : "" ) . ";";
==> b1049 <==
# s1
==> b1055 <==
# S1
my @tests =
- ( [$x],
+ ( [$x],
[ [ [
"aa",
"b",
# S2
my @tests =
- ( [$x],
+ ( [$x],
[ [ [
"aa",
"b",
{
my %tests = (
-8589934592 =>
- [ 9,
+ [ 9,
-203,
qr/Oct \d+ .* 1697$/
],
{
my %tests = (
-8589934592 =>
- [ 9,
+ [ 9,
-203,
qr/Oct \d+ .* 1697$/
],
<h1>Perltidy Change Log</h1>
-<h2>2024 02 02.02</h2>
-
-<pre><code>- The option --valign-signed-numbers, or -vsn is now the default. It
+<h2>2024 02 02.03</h2>
+
+<pre><code>- Add option --valign-wide-equals, or -vwe, for issue git #135.
+ Setting this parameter causes the following assignment operators
+
+ = **= += *= &= <<= &&= -= /= |= >>= ||= //= .= %= ^= x=
+
+ to be aligned vertically with the ending = all aligned. For example,
+ here is the default formatting of a snippet of code:
+
+ $str .= SPACE x $total_pad_count;
+ $str_len += $total_pad_count;
+ $total_pad_count = 0;
+ $str .= $rfields->[$j];
+ $str_len += $rfield_lengths->[$j];
+
+ And here is the same code formatted with -vwe:
+
+ # perltidy -vwe
+ $str .= SPACE x $total_pad_count;
+ $str_len += $total_pad_count;
+ $total_pad_count = 0;
+ $str .= $rfields->[$j];
+ $str_len += $rfield_lengths->[$j];
+
+ This option currently is off by default to avoid changing existing formatting.
+
+- In the option --dump-block-summary, the number of sub arguments indicated
+ for each sub now includes any leading object variable passed with
+ an arrow-operator call. Previously the count would have been decreased
+ by one in this case. This change is needed for compatibility with future
+ updates.
+
+- The operator ``**=`` now has spaces on both sides by default. Previously,
+ there was no space on the left. This change makes its spacing the same
+ as all other assignment operators. The previous behavior can be obtained
+ with the parameter setting -nwls='**='.
+
+- The option --file-size-order, or -fso is now the default. When
+ perltidy is given a list of multiple filenames to process, they
+ are sorted by size and processed in order of increasing size.
+ This can significantly reduce memory usage by Perl. This
+ option has always been used in testing, where typically several
+ jobs each operating on thousands of filenames are running at the
+ same time and competing for system resources. If this option
+ is not wanted for some reason, it can be deactivated with -nfso.
+
+- The option --valign-signed-numbers, or -vsn is now the default. It
was introduced in the previous release has been found to significantly
improve the overall appearance of columns of signed and unsigned
numbers. It will change formatting slightly in scripts with columns
<h1 id="VERSION">VERSION</h1>
-<p>This man page documents Perl::Tidy version 20240202.02</p>
+<p>This man page documents Perl::Tidy version 20240202.03</p>
<h1 id="LICENSE">LICENSE</h1>
</li>
</ul>
+</dd>
+<dt id="Aligning-assignment-operators-with---valign-wide-equals-or--vwe"><b>Aligning assignment operators with --valign-wide-equals or -vwe</b></dt>
+<dd>
+
+<p>The following assignment operators are aligned independently by default:</p>
+
+<pre><code> = **= += *= &= <<= &&= -= /= |= >>= ||= //= .= %= ^= x=</code></pre>
+
+<p>Setting <b>--valign-wide-equals</b>, or <b>-vwe</b>, causes them to be vertically alligned together with the trailing <b>=</b> all aligned. For example, here is the default formatting for some code with several of these operators:</p>
+
+<pre><code> $str .= SPACE x $total_pad_count;
+ $str_len += $total_pad_count;
+ $total_pad_count = 0;
+ $str .= $rfields->[$j];
+ $str_len += $rfield_lengths->[$j];</code></pre>
+
+<p>And here is the same code formatted with <b>-vme</b>:</p>
+
+<pre><code> # perltidy -vme
+ $str .= SPACE x $total_pad_count;
+ $str_len += $total_pad_count;
+ $total_pad_count = 0;
+ $str .= $rfields->[$j];
+ $str_len += $rfield_lengths->[$j];</code></pre>
+
+<p>This option was added for issue git #135 and can improve readability, but it is off by default to avoid changing existing formatting.</p>
+
</dd>
</dl>
<p><b>--no-timestamp</b> or <b>-nts</b> will eliminate any time stamps in output files to prevent differences in dates from causing test installation scripts to fail. There are just a couple of places where timestamps normally occur. One is in the headers of html files, and another is when the <b>-cscw</b> option is selected. The default is to allow timestamps (<b>--timestamp</b> or <b>-ts</b>).</p>
-<p><b>--file-size-order</b> or <b>-fso</b> will cause files to be processed in order of increasing size, when multiple files are being processed. This is useful during program development, when large numbers of files with varying sizes are processed, because it can reduce virtual memory usage.</p>
+<p><b>--file-size-order</b> or <b>-fso</b> will cause files to be processed in order of increasing size, when multiple files are being processed. This is particularly useful during program development, when large numbers of files with varying sizes are processed, because it can reduce virtual memory usage. This is the default and can be deactivated with <b>-nfso</b>.</p>
<p><b>--maximum-file-size-mb=n</b> or <b>-maxfs=n</b> specifies the maximum file size in megabytes that perltidy will attempt to format. This parameter is provided to avoid causing system problems by accidentally attempting to format an extremely large data file. Most perl scripts are less than about 2 MB in size. The integer <b>n</b> has a default value of 10, so perltidy will skip formatting files which have a size greater than 10 MB. The command to increase the limit to 20 MB for example would be</p>
<p>This feature was developed to help identify complex sections of code as an aid in refactoring. The McCabe complexity measure follows the definition used by Perl::Critic. By default the table contains these values for subroutines, but the user may request them for any or all blocks of code or packages. For blocks which are loops nested within loops, a postfix '+' to the <code>type</code> is added to indicate possible code complexity. Although the table does not otherwise indicate which blocks are nested in other blocks, this can be determined by computing and comparing the block ending line numbers.</p>
-<p>For subroutines, the number of call arguments (args) is listed in parentheses in the <code>type</code> column. For example, <code>sub(9)</code> indicates a sub with 9 args. Subroutines whose arg count cannot easily be determined are indicated as <code>sub(*)</code>. The count does not include a leading variable named <b>$self</b> or <b>$class</b>.</p>
+<p>For subroutines, the number of call arguments (args) is listed in parentheses in the <code>type</code> column. For example, <code>sub(9)</code> indicates a sub with 9 args. Subroutines whose arg count cannot easily be determined are indicated as <code>sub(*)</code>. The count includes any leading object passed in a method call (such as <b>$self</b>).</p>
<p>By default the table lists subroutines with more than 20 <code>code_lines</code>, but this can be changed with the following two parameters:</p>
<h1 id="VERSION">VERSION</h1>
-<p>This man page documents perltidy version 20240202.02</p>
+<p>This man page documents perltidy version 20240202.03</p>
<h1 id="BUG-REPORTS">BUG REPORTS</h1>
# then the Release version must be bumped, and it is probably past time for
# a release anyway.
- $VERSION = '20240202.02';
+ $VERSION = '20240202.03';
} ## end BEGIN
sub DESTROY {
=head1 VERSION
-This man page documents Perl::Tidy version 20240202.02
+This man page documents Perl::Tidy version 20240202.03
=head1 LICENSE
use strict;
use warnings;
use English qw( -no_match_vars );
-our $VERSION = '20240202.02';
+our $VERSION = '20240202.03';
use constant EMPTY_STRING => q{};
use constant SPACE => q{ };
use strict;
use warnings;
use English qw( -no_match_vars );
-our $VERSION = '20240202.02';
+our $VERSION = '20240202.03';
use constant EMPTY_STRING => q{};
package Perl::Tidy::FileWriter;
use strict;
use warnings;
-our $VERSION = '20240202.02';
+our $VERSION = '20240202.03';
use constant DEVEL_MODE => 0;
use constant EMPTY_STRING => q{};
use Carp;
use English qw( -no_match_vars );
use List::Util qw( min max first ); # min, max first are in Perl 5.8
-our $VERSION = '20240202.02';
+our $VERSION = '20240202.03';
# The Tokenizer will be loaded with the Formatter
##use Perl::Tidy::Tokenizer; # for is_keyword()
if (@conflicts) {
my $msg = join( "\n ",
" Conflict: These conflicts with --ignore-old-breakponts (-iob) will be turned off:",
- @conflicts )
- . "\n";
+ @conflicts ) . "\n";
Warn($msg);
}
package Perl::Tidy::HtmlWriter;
use strict;
use warnings;
-our $VERSION = '20240202.02';
+our $VERSION = '20240202.03';
use Carp;
use English qw( -no_match_vars );
use strict;
use warnings;
use Carp;
-our $VERSION = '20240202.02';
+our $VERSION = '20240202.03';
use constant DEVEL_MODE => 0;
use constant EMPTY_STRING => q{};
use strict;
use warnings;
use Carp;
-our $VERSION = '20240202.02';
+our $VERSION = '20240202.03';
use constant DEVEL_MODE => 0;
use strict;
use warnings;
-our $VERSION = '20240202.02';
+our $VERSION = '20240202.03';
BEGIN {
package Perl::Tidy::Logger;
use strict;
use warnings;
-our $VERSION = '20240202.02';
+our $VERSION = '20240202.03';
use Carp;
use English qw( -no_match_vars );
use warnings;
use English qw( -no_match_vars );
-our $VERSION = '20240202.02';
+our $VERSION = '20240202.03';
use Carp;
{ #<<< A non-indenting brace to contain all lexical variables
-our $VERSION = '20240202.02';
+our $VERSION = '20240202.03';
use English qw( -no_match_vars );
use Perl::Tidy::VerticalAligner::Alignment;
use Perl::Tidy::VerticalAligner::Line;
use strict;
use warnings;
-our $VERSION = '20240202.02';
+our $VERSION = '20240202.03';
sub new {
my ( $class, $rarg ) = @_;
use strict;
use warnings;
-our $VERSION = '20240202.02';
+our $VERSION = '20240202.03';
use English qw( -no_match_vars );
sub AUTOLOAD {