# Perltidy Change Log
-## 2024 05 11.01
+## 2024 05 11.02
+
+ - Fix issue git #143, extend -add-trailing-commas to apply to a list
+ with just a fat comma.
- Fix issue git #142, test failure installing on perl versions before
version 5.10. The error caused the new parameter
t/snippets28.t
t/snippets29.t
t/snippets3.t
+t/snippets30.t
t/snippets4.t
t/snippets5.t
t/snippets6.t
=head1 VERSION
-This man page documents perltidy version 20240511.01
+This man page documents perltidy version 20240511.02
=head1 BUG REPORTS
<h1>Perltidy Change Log</h1>
+<h2>2024 05 11.02</h2>
+
+<pre><code>- Fix issue git #143, extend -add-trailing-commas to apply to a list
+ with just a fat comma.
+
+- Fix issue git #142, test failure installing on perl versions before
+ version 5.10. The error caused the new parameter
+ -interbracket-arrow-style=s not to work. Except for this limitation,
+ Version 20240511 will work on older perl versions.
+</code></pre>
+
<h2>2024 05 11</h2>
<pre><code>- The option --valign-signed-numbers, or -vsn is now the default. It
of vertically aligned signed and unsigned numbers.
Use -nvsn to turn this option off and avoid this change.
-- Previously, a line break was made before a short concatenated terminal
- quoted string, such as "\n", if the previous line had a greater
- starting indentation. The break is now placed after the short quote.
- This keeps code a little more compact. For example:
-
-# old rule: break before "\n" here because '$name' has more indentation:
-my $html = $this->SUPER::genObject( $query, $bindNode, $field . ":$var",
- $name, "remove", "UNCHECKED" )
- . "\n";
-
-# new rule: break after a short terminal quote like "\n" for compactness;
-my $html = $this->SUPER::genObject( $query, $bindNode, $field . ":$var",
- $name, "remove", "UNCHECKED" ) . "\n";
-
- The option --delete-repeated-commas is now the default.
It makes the following checks and changes:
Use --nodelete-repeated-commas, or -ndrc, to retain repeated commas.
+- Previously, a line break was always made before a concatenated
+ quoted string, such as "\n", if the previous line had a greater
+ starting indentation. An exception is now made for a short concatenated
+ terminal quote. This keeps code a little more compact. For example:
+
+# basic rule: break before "\n" here because '$name' has more indentation:
+my $html = $this->SUPER::genObject( $query, $bindNode, $field . ":$var",
+ $name, "remove", "UNCHECKED" )
+ . "\n";
+
+# modified rule: make an exception for a short terminal quote like "\n"
+my $html = $this->SUPER::genObject( $query, $bindNode, $field . ":$var",
+ $name, "remove", "UNCHECKED" ) . "\n";
+
- 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
<h1 id="VERSION">VERSION</h1>
-<p>This man page documents Perl::Tidy version 20240511</p>
+<p>This man page documents Perl::Tidy version 20240511.02</p>
<h1 id="LICENSE">LICENSE</h1>
<p>A second optional item of information which can be given for parentheses is an alphanumeric letter which is used to limit the selection further depending on the type of token immediately before the paren. The possible letters are currently 'k', 'K', 'f', 'F', 'w', and 'W', with these meanings for matching whatever precedes an opening paren:</p>
-<pre><code> 'k' matches if the previous nonblank token is a perl built-in keyword (such as 'if', 'while'),
+<pre><code> 'k' matches if the previous nonblank token is a perl built-in keyword
+ (such as 'if', 'while'),
'K' matches if 'k' does not, meaning that the previous token is not a keyword.
'f' matches if the previous token is a function other than a keyword.
'F' matches if 'f' does not.
<p>A trailing comma is a comma following the last item of a list. Perl allows trailing commas but they are not required. By default, perltidy does not add or delete trailing commas, but it is possible to manipulate them with the following set of three related parameters:</p>
-<pre><code> --want-trailing-commas=s, -wtc=s - defines where trailing commas are wanted
- --add-trailing-commas, -atc - gives permission to add trailing commas to match the style wanted
- --delete-trailing-commas, -dtc - gives permission to delete trailing commas which do not match the style wanted</code></pre>
+<ul>
+
+<li><p><b>--want-trailing-commas=s, -wtc=s</b> - defines where trailing commas are wanted</p>
+
+</li>
+<li><p><b>--add-trailing-commas, -atc</b> - gives permission to add trailing commas to match the style wanted</p>
+
+</li>
+<li><p><b>--delete-trailing-commas, -dtc</b> - gives permission to delete trailing commas which do not match the style wanted</p>
+
+</li>
+</ul>
<p>The parameter <b>--want-trailing-commas=s</b>, or <b>-wtc=s</b>, defines a preferred style. The string <b>s</b> indicates which lists should get trailing commas, as follows:</p>
<p>For parentheses, an additional item of information which can be given is an alphanumeric letter which is used to limit the selection further depending on the type of token immediately before the opening paren. The possible letters are currently 'k', 'K', 'f', 'F', 'w', and 'W', with these meanings for matching whatever precedes an opening paren:</p>
-<pre><code> 'k' matches if the previous nonblank token is a perl built-in keyword (such as 'if', 'while'),
+<pre><code> 'k' matches if the previous nonblank token is a perl built-in keyword
+ (such as 'if', 'while'),
'K' matches if 'k' does not, meaning that the previous token is not a keyword.
'f' matches if the previous token is a function other than a keyword.
'F' matches if 'f' does not.
<ul>
-<li><p>For the implementation of these parameters, a <b>list</b> is basically taken to be a container of items (parens, square brackets, or braces), which is not a code block, with one or more commas. These parameters only apply to something that fits this definition of a list.</p>
+<li><p>For the implementation of these parameters, a <b>list</b> is basically taken to be a container of items (parens, square brackets, or braces), which is not a code block, with one or more commas or fat commas. These parameters only apply to something that fits this definition of a list.</p>
<p>Note that a paren-less list of parameters is not a list by this definition, so these parameters have no effect on a paren-less list.</p>
<p>It is possible to be more specific in matching parentheses by preceding them with a letter. The possible letters are 'k', 'K', 'f', 'F', 'w', and 'W', with these meanings (these are the same as used in the <b>--weld-nested-exclusion-list</b> and <b>--line-up-parentheses-exclusion-list</b> parameters):</p>
-<pre><code> 'k' matches if the previous nonblank token is a perl built-in keyword (such as 'if', 'while'),
+<pre><code> 'k' matches if the previous nonblank token is a perl built-in keyword
+ (such as 'if', 'while'),
'K' matches if 'k' does not, meaning that the previous token is not a keyword.
'f' matches if the previous token is a function other than a keyword.
'F' matches if 'f' does not.
<h1 id="VERSION">VERSION</h1>
-<p>This man page documents perltidy version 20240511</p>
+<p>This man page documents perltidy version 20240511.02</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 = '20240511.01';
+ $VERSION = '20240511.02';
} ## end BEGIN
sub DESTROY {
=head1 VERSION
-This man page documents Perl::Tidy version 20240511.01
+This man page documents Perl::Tidy version 20240511.02
=head1 LICENSE
use strict;
use warnings;
use English qw( -no_match_vars );
-our $VERSION = '20240511.01';
+our $VERSION = '20240511.02';
use constant EMPTY_STRING => q{};
use constant SPACE => q{ };
use strict;
use warnings;
use English qw( -no_match_vars );
-our $VERSION = '20240511.01';
+our $VERSION = '20240511.02';
use constant EMPTY_STRING => q{};
package Perl::Tidy::FileWriter;
use strict;
use warnings;
-our $VERSION = '20240511.01';
+our $VERSION = '20240511.02';
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 = '20240511.01';
+our $VERSION = '20240511.02';
# 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 = '20240511.01';
+our $VERSION = '20240511.02';
use Carp;
use English qw( -no_match_vars );
use strict;
use warnings;
use Carp;
-our $VERSION = '20240511.01';
+our $VERSION = '20240511.02';
use constant DEVEL_MODE => 0;
use constant EMPTY_STRING => q{};
use strict;
use warnings;
use Carp;
-our $VERSION = '20240511.01';
+our $VERSION = '20240511.02';
use constant DEVEL_MODE => 0;
use strict;
use warnings;
-our $VERSION = '20240511.01';
+our $VERSION = '20240511.02';
BEGIN {
package Perl::Tidy::Logger;
use strict;
use warnings;
-our $VERSION = '20240511.01';
+our $VERSION = '20240511.02';
use Carp;
use English qw( -no_match_vars );
use warnings;
use English qw( -no_match_vars );
-our $VERSION = '20240511.01';
+our $VERSION = '20240511.02';
use Carp;
{ #<<< A non-indenting brace to contain all lexical variables
-our $VERSION = '20240511.01';
+our $VERSION = '20240511.02';
use English qw( -no_match_vars );
use Scalar::Util 'refaddr';
use Perl::Tidy::VerticalAligner::Alignment;
use strict;
use warnings;
-our $VERSION = '20240511.01';
+our $VERSION = '20240511.02';
sub new {
my ( $class, $rarg ) = @_;
use strict;
use warnings;
-our $VERSION = '20240511.01';
+our $VERSION = '20240511.02';
use English qw( -no_match_vars );
sub AUTOLOAD {