# Perltidy Change Log
-## 2024 05 11.03
+## 2024 05 11.04
+
+ - Updates for issue git #151:
+ (1) --warn-variable-types=u is now okay if it is on the command line
+ with a named file.
+ (2) --warn-variable-exclusion-list=s now allows leading and/or
+ trailing * on variable names to allow a wildcard match. For example
+ -wvxl='*_unused' is okay.
+ (3) --dump-unusual-variables now outputs the filename.
- A option was added to filter unimplemented parameters from perltidy
configuration files, suggested in git #146. If a line in the config
=head1 VERSION
-This man page documents perltidy version 20240511.03
+This man page documents perltidy version 20240511.04
=head1 BUG REPORTS
<h1>Perltidy Change Log</h1>
-<h2>2024 05 11.02</h2>
+<h2>2024 05 11.04</h2>
-<pre><code>- Fix issue git #143, extend -add-trailing-commas to apply to a list
+<pre><code>- A option was added to filter unimplemented parameters from perltidy
+ configuration files, suggested in git #146. If a line in the config
+ file begins with three dashes followed by a parameter name
+ (rather than two), then the line will be removed if the parameter is
+ unknown. Otherwise, a dash will be removed to make the line valid.
+
+- Parameters --dump-mismatched-args (or -dma) and
+ --warn-mismatched-arg (or -wma) have been updated to catch more
+ arg count issues.
+
+- 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
<h1 id="VERSION">VERSION</h1>
-<p>This man page documents Perl::Tidy version 20240511.02</p>
+<p>This man page documents Perl::Tidy version 20240511.04</p>
<h1 id="LICENSE">LICENSE</h1>
</li>
</ul>
+</dd>
+<dt id="Skipping-a-line-with-an-unknown-parameter"><b>Skipping a line with an unknown parameter</b></dt>
+<dd>
+
+<p>Versions of perltidy greater than 20240511 have an option to filter unrecognized parameters from a perltidy command file. If a line in the file begins with <b>three dashes</b> followed by a parameter name (rather than one or two), then the line will be removed if the parameter is unknown. Otherwise, a dash will be removed to make the line valid. This option was added to allow a single command file to be used during the transition to a new version of perltidy.</p>
+
</dd>
<dt id="Creating-a-new-abbreviation"><b>Creating a new abbreviation</b></dt>
<dd>
<p>will process <i>somefile.pl</i> normally but issue a warning if either of the issues 's' or 'r', but not 'p', described above, are encountered.</p>
-<p>A limitation is that warnings may not be requested for unused variables, type 'u'. The is because this would produce many needless warnings, especially when perltidy is run on small snippets of code from within an editor. So unused variables can only be found with the <b>-duv</b> option described in the previous section.</p>
+<p>The 'u' option (unused) has a limitation: it is not allowed in a <i>.perltidyrc</i> configuration file. But it can be used on the command line provided that perltidy is operating on a named file. This rule is necessary to avoid warnings when perltidy is run on small snippets of code from within an editor.</p>
+
+<p>A companion flag, <b>--warn-variable-exclusion-list=string</b>, or <b>-wvxl=string</b>, can be used to skip warning checks for a list of variable names. A leading and/or trailing '*' may be placed on any of these variable names to allow a partial match. For example</p>
-<p>A companion flag, <b>--warn-variable-exclusion-list=string</b>, or <b>-wvxl=string</b>, can be used to skip warning checks for a list of variables. For example,</p>
+<p>For example,</p>
-<pre><code> perltidy -wvt='*' -wvxl='$self $class' somefile.pl</code></pre>
+<pre><code> perltidy -wvt='*' -wvxl='$self $class *_unused' somefile.pl</code></pre>
-<p>will do all possible checks but not report any warnings for variables <code>$self</code> and <code>$class</code>.</p>
+<p>will do all possible checks but not report any warnings for variables <code>$self</code>, <code>$class</code>, and for example <code>$value_unused</code>.</p>
</dd>
<dt id="Use---dump-mixed-call-parens-to-find-functions-called-both-with-and-without-parens"><b>Use --dump-mixed-call-parens to find functions called both with and without parens</b></dt>
<ul>
-<li><p>This option works best for subs which unpack call args in an orderly manner near the beginning of the sub from <code>@_</code> and/or with <code>shift</code> operations. If individual elements of the @_ array are directly accessed then the number of sub args is considered indeterminate.</p>
+<li><p>This option works best for subs which unpack call args in an orderly manner near the beginning of the sub from <code>@_</code> and/or with <code>shift</code> operations. It will also work for direct access to specific elements of the @_ array. However if the coding for arg extraction is complex then the number of sub args will be considered indeterminate and a count cannot be checked.</p>
</li>
<li><p>Sub calls made without parentheses around the args are not checked.</p>
<dt id="Use---warn-mismatched-args-to-produce-a-warning-for-function-calls-with-args-not-matching-sub-declarations"><b>Use --warn-mismatched-args to produce a warning for function calls with args not matching sub declarations</b>.</dt>
<dd>
-<p>This is similar to the <b>-dump</b> parameter described above except that any mismatches are reported in the error file and otherwise formatting continues normally. Thus</p>
+<p>This is similar to the <b>-dump</b> parameter described above except that any mismatches are reported in the error file and otherwise formatting continues normally. The basic usage is</p>
<pre><code> perltidy -wma somefile.pl</code></pre>
<h1 id="VERSION">VERSION</h1>
-<p>This man page documents perltidy version 20240511.02</p>
+<p>This man page documents perltidy version 20240511.04</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.03';
+ $VERSION = '20240511.04';
} ## end BEGIN
sub DESTROY {
=head1 VERSION
-This man page documents Perl::Tidy version 20240511.03
+This man page documents Perl::Tidy version 20240511.04
=head1 LICENSE
use strict;
use warnings;
use English qw( -no_match_vars );
-our $VERSION = '20240511.03';
+our $VERSION = '20240511.04';
use constant EMPTY_STRING => q{};
use constant SPACE => q{ };
use strict;
use warnings;
use English qw( -no_match_vars );
-our $VERSION = '20240511.03';
+our $VERSION = '20240511.04';
use constant EMPTY_STRING => q{};
package Perl::Tidy::FileWriter;
use strict;
use warnings;
-our $VERSION = '20240511.03';
+our $VERSION = '20240511.04';
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.03';
+our $VERSION = '20240511.04';
# 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.03';
+our $VERSION = '20240511.04';
use Carp;
use English qw( -no_match_vars );
use strict;
use warnings;
use Carp;
-our $VERSION = '20240511.03';
+our $VERSION = '20240511.04';
use constant DEVEL_MODE => 0;
use constant EMPTY_STRING => q{};
use strict;
use warnings;
use Carp;
-our $VERSION = '20240511.03';
+our $VERSION = '20240511.04';
use constant DEVEL_MODE => 0;
use strict;
use warnings;
-our $VERSION = '20240511.03';
+our $VERSION = '20240511.04';
BEGIN {
package Perl::Tidy::Logger;
use strict;
use warnings;
-our $VERSION = '20240511.03';
+our $VERSION = '20240511.04';
use Carp;
use English qw( -no_match_vars );
use warnings;
use English qw( -no_match_vars );
-our $VERSION = '20240511.03';
+our $VERSION = '20240511.04';
use Carp;
{ #<<< A non-indenting brace to contain all lexical variables
-our $VERSION = '20240511.03';
+our $VERSION = '20240511.04';
use English qw( -no_match_vars );
use Scalar::Util 'refaddr';
use Perl::Tidy::VerticalAligner::Alignment;
use strict;
use warnings;
-our $VERSION = '20240511.03';
+our $VERSION = '20240511.04';
sub new {
my ( $class, $rarg ) = @_;
use strict;
use warnings;
-our $VERSION = '20240511.03';
+our $VERSION = '20240511.04';
use English qw( -no_match_vars );
sub AUTOLOAD {