]> git.donarmstrong.com Git - perltidy.git/commitdiff
update to version 20240903
authorSteve Hancock <perltidy@users.sourceforge.net>
Mon, 2 Sep 2024 16:06:56 +0000 (09:06 -0700)
committerSteve Hancock <perltidy@users.sourceforge.net>
Mon, 2 Sep 2024 16:06:56 +0000 (09:06 -0700)
24 files changed:
CHANGES.md
MANIFEST
bin/perltidy
docs/ChangeLog.html
docs/Tidy.html
docs/perltidy.html
lib/Perl/Tidy.pm
lib/Perl/Tidy.pod
lib/Perl/Tidy/Debugger.pm
lib/Perl/Tidy/Diagnostics.pm
lib/Perl/Tidy/FileWriter.pm
lib/Perl/Tidy/Formatter.pm
lib/Perl/Tidy/HtmlWriter.pm
lib/Perl/Tidy/IOScalar.pm
lib/Perl/Tidy/IOScalarArray.pm
lib/Perl/Tidy/IndentationItem.pm
lib/Perl/Tidy/Logger.pm
lib/Perl/Tidy/Tokenizer.pm
lib/Perl/Tidy/VerticalAligner.pm
lib/Perl/Tidy/VerticalAligner/Alignment.pm
lib/Perl/Tidy/VerticalAligner/Line.pm
perltidyrc
t/testwide-passthrough.t
t/testwide-tidy.t

index a6f94f4b1010ce5700b35da63091d44b9615b4f8..d95673dcd271a138c2d3cd692de6260545e8689a 100644 (file)
@@ -1,6 +1,6 @@
 # Perltidy Change Log
 
-## 2024 05 11.10
+## 2024 09 03
 
     - Add partial support for Syntax::Operator::In and Syntax::Keyword::Match
       (see git #162).
@@ -70,8 +70,8 @@
     - A option was added to filter unimplemented parameters from perltidy
       configuration files, suggested in git #146.  It works like this: 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
+      parameter name (rather than two dashes), 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
@@ -81,6 +81,9 @@
     - Fixed issue git #143, extend -add-trailing-commas to apply to a list
       with just a fat comma.
 
+    - The minimum perl version is 5.8.1. Previously it was 5.8.0, which was
+      not correct because of the use of utf8::is_utf8.
+
     - Fixed 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,
index 0e412d583ca5429780f4bb77790631d618d6bae8..0070037dcabaefff5e2749bbb4ac8294c5f5f7a5 100644 (file)
--- a/MANIFEST
+++ b/MANIFEST
@@ -37,7 +37,6 @@ lib/Perl/Tidy.pm
 lib/Perl/Tidy.pod
 lib/Perl/Tidy/Debugger.pm
 lib/Perl/Tidy/Diagnostics.pm
-lib/Perl/Tidy/diff.txt
 lib/Perl/Tidy/FileWriter.pm
 lib/Perl/Tidy/Formatter.pm
 lib/Perl/Tidy/HtmlWriter.pm
index d8589048497d4b39f7d51bd4b838a4cabf67a5e7..9e4140f40046ca58691c47dfc68bfa9f735a07d1 100755 (executable)
@@ -6955,7 +6955,7 @@ The perltidy binary uses the Perl::Tidy module and is installed when that module
 
 =head1 VERSION
 
-This man page documents perltidy version 20240511.10
+This man page documents perltidy version 20240903
 
 =head1 BUG REPORTS
 
index 2fea347c95ec31fb28362bb547633dd31d854ea4..b82d91319572af89de7469697705654caf1def57 100644 (file)
@@ -1,6 +1,6 @@
 <h1>Perltidy Change Log</h1>
 
-<h2>2024 05 11.10</h2>
+<h2>2024 09 03</h2>
 
 <pre><code>- Add partial support for Syntax::Operator::In and Syntax::Keyword::Match
   (see git #162).
@@ -70,8 +70,8 @@
 - A option was added to filter unimplemented parameters from perltidy
   configuration files, suggested in git #146.  It works like this: 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
+  parameter name (rather than two dashes), 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
@@ -81,6 +81,9 @@
 - Fixed issue git #143, extend -add-trailing-commas to apply to a list
   with just a fat comma.
 
+- The minimum perl version is 5.8.1. Previously it was 5.8.0, which was
+  not correct because of the use of utf8::is_utf8.
+
 - Fixed 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,
index 803a9a18ee19a7f9e98a81a5389d5a2d8ee51aac..f2e4b572c56879967679b52a31a5a4546f380afc 100644 (file)
 
 <h1 id="VERSION">VERSION</h1>
 
-<p>This man page documents Perl::Tidy version 20240511.10</p>
+<p>This man page documents Perl::Tidy version 20240903</p>
 
 <h1 id="LICENSE">LICENSE</h1>
 
index 5687b0101aa479e0f36259c9fe62fe1d42123f2b..59587263712f0d01df55ddb2c77b7ba585820a66 100644 (file)
 </ul>
 
 </dd>
-<dt id="use---dump-unusual-variables-to-find-unused-reused-and-certain-other-variables-of-interest"><b>use --dump-unusual-variables to find unused, reused, and certain other variables of interest</b></dt>
+<dt id="Use---dump-unusual-variables-to-find-unused-reused-and-certain-other-variables-of-interest"><b>Use --dump-unusual-variables to find unused, reused, and certain other variables of interest</b></dt>
 <dd>
 
 <p>Variables with certain properties of interest to a programmer can be listed with <b>--dump-unusual-variables</b> or <b>-duv</b>. This parameter must be on the command line, along with a single file name. It causes perltidy to scan the file for certain variable types, write any found to the standard output, and then immediately exit without doing any formatting. For example</p>
 <dt id="s:-sigil-change-but-reused-bareword"><b>s: sigil change but reused bareword</b></dt>
 <dd>
 
-<p>These are variables which have the same bareword name but a different sigil (<b>$</b>, <b>@</b>, or <b>%</b>) as another variable in the same scope. For example, this occurs if variables <b>$data</b> and <b>%data</b> share the same scope. This can be confusing and can be avoided by renaming one of the variables.</p>
+<p>These are variables which have the same bareword name but a different sigil (<b>$</b>, <b>@</b>, or <b>%</b>) as another variable in the same scope. For example, this occurs if variables <b>$data</b> and <b>%data</b> share the same scope. This can also be confusing for the reasons mentioned above and can be avoided by renaming one of the variables.</p>
 
 </dd>
 <dt id="p:-package-crossing-variables"><b>p: package-crossing variables</b></dt>
 <dt id="Use---warn-variable-types-to-warn-about-certain-variable-types"><b>Use --warn-variable-types to warn about certain variable types</b></dt>
 <dd>
 
-<p>The flag <b>--warn-variable-types=string</b>, or <b>-wvt=string</b>, can be used to produce a warning message if certain of the above variable types are encountered during formatting. All possible variable warnings may be requested with <b>-wvt=&#39;*&#39;</b> or <b>-wvt=1</b>.</p>
+<p>The flag <b>--warn-variable-types=string</b>, or <b>-wvt=string</b>, is the <b>--warn</b> counterpart to <b>--dump-unusual-variables</b>, and can be used to produce a warning message if certain of the above variable types are encountered during formatting. All possible variable warnings may be requested with <b>-wvt=&#39;*&#39;</b> or <b>-wvt=1</b>.</p>
 
 <p>For example,</p>
 
 
 <p>will process <i>somefile.pl</i> normally but issue a warning if either of the issues <b>s</b> or <b>r</b>, described above, are encountered.</p>
 
-<p>The <b>u</b> and <b>c</b> options (unused variables and constants) have a limitation: they may be silently turned off if perltidy detects that it is operating on just part of a script. This logic is necessary to avoid warnings when perltidy is run on small snippets of code from within an editor. These options are never turned off if perltidy receives a <b>-wvt</b> parameter on the command line and is operating on a named file.</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 &#39;*&#39; may be placed on any of these variable names to allow a partial match.</p>
 
 <p>For example,</p>
 
-<pre><code>   perltidy -wvt=&#39;*&#39; -wvxl=&#39;$self $class *_unused&#39;  somefile.pl</code></pre>
+<pre><code>   perltidy -wvt=1 -wvxl=&#39;$self $class *_unused&#39;  somefile.pl</code></pre>
 
 <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>
 
+<p>This partial match option provides a way to trigger a warning message when a new unused variable is detected in a script. This can be accomplished by adding a unique suffix to the names of existing unused variables, such as <code>_unused</code>. This suffix is then added to the exclusion list.</p>
+
+<p>As a specific example, consider the following line which is part of some debug code which only references the latter three variables (but might someday need to reference the package variable too).</p>
+
+<pre><code>    my ( $package_uu, $filename, $line, $subroutine ) = caller();</code></pre>
+
+<p>The unused variable, <code>$package_uu</code>, has been specially marked with suffix <code>_uu</code>. No type <b>u</b> (unused variable) warning will be produced provided that this wildcard suffix is in the exclusion list:</p>
+
+<pre><code>    -wvxl=&#39;*_uu&#39;</code></pre>
+
 </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>
 <dd>
 
 <h1 id="VERSION">VERSION</h1>
 
-<p>This man page documents perltidy version 20240511.10</p>
+<p>This man page documents perltidy version 20240903</p>
 
 <h1 id="BUG-REPORTS">BUG REPORTS</h1>
 
index d9623e0578945e4a1fd3e18d79abd6e7d73f147a..53426ad6f3cc2c6a3d760ac38c9b9fbe655be22a 100644 (file)
 
 package Perl::Tidy;
 
-# perlver reports minimum version needed is 5.8.0
+# perlver reports minimum version needed is 5.8.1
 # 5.004 needed for IO::File
 # 5.008 needed for wide characters
-use 5.008;
+# 5.008001 needed for utf8::is_utf8
+# 5.008001 needed for Scalar::Util::refaddr
+use 5.008001;
 use warnings;
 use strict;
 use Exporter;
@@ -133,7 +135,7 @@ BEGIN {
     # then the Release version must be bumped, and it is probably past time for
     # a release anyway.
 
-    $VERSION = '20240511.10';
+    $VERSION = '20240903';
 } ## end BEGIN
 
 sub DESTROY {
@@ -370,7 +372,7 @@ EOM
                     1;
                 }
                   or Die(
-"Timeout reading stdin using -to=$timeout_in_seconds seconds. Use -tos=0 to skip timeout check.\n"
+"Timeout reading stdin using -tos=$timeout_in_seconds seconds. Use -tos=0 to skip timeout check.\n"
                   );
             }
             else {
@@ -494,7 +496,7 @@ sub is_char_mode {
 
     # This function isolates the call to Perl's internal function
     # utf8::is_utf8() which is true for strings represented in an 'upgraded
-    # form'. It is available after Perl version 5.8.
+    # form'. It is available AFTER Perl version 5.8.
     # See https://perldoc.perl.org/Encode.
     # See also comments in Carp.pm and other modules using this function
 
index 3cc5cefb724f5a2cdde10a0e8019531d84cbb86f..2a8de7b8829e24bd889384582944af10acee0c0a 100644 (file)
@@ -469,7 +469,7 @@ The module 'Perl::Tidy' comes with a binary 'perltidy' which is installed when t
 
 =head1 VERSION
 
-This man page documents Perl::Tidy version 20240511.10
+This man page documents Perl::Tidy version 20240903
 
 =head1 LICENSE
 
index 2fb8f5db1a99bc9e17144f79cc99b9b9d64b1905..18dc0d2fa2e4dc5bf6cd9dd96d3ada3d6509d7bd 100644 (file)
@@ -8,7 +8,7 @@ package Perl::Tidy::Debugger;
 use strict;
 use warnings;
 use English qw( -no_match_vars );
-our $VERSION = '20240511.10';
+our $VERSION = '20240903';
 
 use constant EMPTY_STRING => q{};
 use constant SPACE        => q{ };
index 47dd56e2655ed24f53d2e48abcc788e3439b47dd..5b1252973161742ea1adff5aa43b87cb6df8a5a4 100644 (file)
@@ -18,7 +18,7 @@ package Perl::Tidy::Diagnostics;
 use strict;
 use warnings;
 use English qw( -no_match_vars );
-our $VERSION = '20240511.10';
+our $VERSION = '20240903';
 
 use constant EMPTY_STRING => q{};
 
index 2168c1e8f198eb2bb1fd2d292ea7205000cb86fb..499608cb6efc2dd294355a7bb19b2c5b587d0b31 100644 (file)
@@ -16,7 +16,7 @@
 package Perl::Tidy::FileWriter;
 use strict;
 use warnings;
-our $VERSION = '20240511.10';
+our $VERSION = '20240903';
 
 use constant DEVEL_MODE   => 0;
 use constant EMPTY_STRING => q{};
index 17b7560b3d894bc73bbad939c7e3423e5c9170c8..2e5d2a6cfe5e120f97f106cc47232c6b14e2c3ab 100644 (file)
@@ -76,7 +76,7 @@ use constant BACKSLASH    => 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.10';
+our $VERSION = '20240903';
 
 # The Tokenizer will be loaded with the Formatter
 ##use Perl::Tidy::Tokenizer;    # for is_keyword()
@@ -9090,7 +9090,7 @@ sub get_qw_list {
     $string =~ s/^\s*//;                   # trim left
     $string =~ s/\s*$//;                   # trim right
 
-    my @list = split SPACE, $string;
+    my @list = split /\s+/, $string;
     return ( $K_last_q, \@list );
 } ## end sub get_qw_list
 
index 0570eca06bb957c6213c003709a09c3c91e82065..0b1b5726c945988266423af4afc2023a82306255 100644 (file)
@@ -7,7 +7,7 @@
 package Perl::Tidy::HtmlWriter;
 use strict;
 use warnings;
-our $VERSION = '20240511.10';
+our $VERSION = '20240903';
 
 use Carp;
 use English qw( -no_match_vars );
index 6cabad80bb8565e2f1e0fd0f0f78e4b347df71db..d3aefd47d0a0c263775e0fe57d2c528131a38192 100644 (file)
@@ -10,7 +10,7 @@ package Perl::Tidy::IOScalar;
 use strict;
 use warnings;
 use Carp;
-our $VERSION = '20240511.10';
+our $VERSION = '20240903';
 
 use constant DEVEL_MODE   => 0;
 use constant EMPTY_STRING => q{};
index a54340dbd3be9410bdb35817e48913de5fd4dd9d..89a4ec3b862fc65fb863efb4877b08dc368f233d 100644 (file)
@@ -14,7 +14,7 @@ package Perl::Tidy::IOScalarArray;
 use strict;
 use warnings;
 use Carp;
-our $VERSION = '20240511.10';
+our $VERSION = '20240903';
 
 use constant DEVEL_MODE => 0;
 
index e6d284abae61013ff06cc3d55044d2541ea35956..0a9a6531e0c474092a22f504a947527b435f4255 100644 (file)
@@ -9,7 +9,7 @@ package Perl::Tidy::IndentationItem;
 use strict;
 use warnings;
 
-our $VERSION = '20240511.10';
+our $VERSION = '20240903';
 
 BEGIN {
 
index f3dd417e2630b2be884033e4d820b2948ffad453..f08e6f0f138092429a1a11b79ce17a61815996fe 100644 (file)
@@ -8,7 +8,7 @@
 package Perl::Tidy::Logger;
 use strict;
 use warnings;
-our $VERSION = '20240511.10';
+our $VERSION = '20240903';
 use Carp;
 use English qw( -no_match_vars );
 
index ad4dc6837cccc0e725cd33895946b02081fd3778..7ee5ada0fc90c7a2169b0e64229fec471359a2b5 100644 (file)
@@ -33,7 +33,7 @@ use strict;
 use warnings;
 use English qw( -no_match_vars );
 
-our $VERSION = '20240511.10';
+our $VERSION = '20240903';
 
 use Carp;
 
index 7d070773a1660c1e3e68c57da5ff1f177bb49176..93febef038f8b756d0e616b3d267205b96e2464b 100644 (file)
@@ -5,9 +5,9 @@ use Carp;
 
 { #<<< A non-indenting brace to contain all lexical variables
 
-our $VERSION = '20240511.10';
+our $VERSION = '20240903';
 use English qw( -no_match_vars );
-use Scalar::Util 'refaddr';
+use Scalar::Util 'refaddr';    # perl 5.8.1 and later
 use Perl::Tidy::VerticalAligner::Alignment;
 use Perl::Tidy::VerticalAligner::Line;
 
index 62c5bd1a38f530a2efaf64816797a3872ff3a049..92a4528d3876862d6afadc81900c266bef14884d 100644 (file)
@@ -9,7 +9,7 @@ package Perl::Tidy::VerticalAligner::Alignment;
 use strict;
 use warnings;
 
-our $VERSION = '20240511.10';
+our $VERSION = '20240903';
 
 sub new {
     my ( $class, $rarg ) = @_;
index 7d2ff4a3f897098c9a0aec278e81f843a5b7bb26..6923520b4551b397f139345dcfab5d106ae85dc7 100644 (file)
@@ -10,7 +10,7 @@ package Perl::Tidy::VerticalAligner::Line;
 use strict;
 use warnings;
 
-our $VERSION = '20240511.10';
+our $VERSION = '20240903';
 use English qw( -no_match_vars );
 
 sub AUTOLOAD {
index 5b0709efa8d4efe71a903d4de19789ebc3b3d257..e8f5da38c6c70f0381cc64a681300d59102c21e2 100644 (file)
@@ -13,6 +13,7 @@
 --warn-missing-else
 
 # warn if certain of the 'unusual' variables are seen
+# variable names ending in '_uu' are excluded from warnings
 --warn-variable-types='*'
 --warn-variable-exclusion-list='$self $class *_uu'
 
index 877409fd99e0db3f50e7ec9809e0533c2bfa158e..a26b4885fe079a3b3e190fe86763f2f49e557fdb 100644 (file)
@@ -33,7 +33,7 @@ sub my_note {
 
     # try to work around problem where sub Test::More::note does not exist
     # in older versions of perl
-    if ($] >= 5.010) {
+    if ($] > 5.010) {
        note($msg);
     }
     return;
index 13ba6405509a63a4d4bd2cbe297afe3f9e0d1609..a412a5cb6388395fcea9295eeca8e7e5a4bc18d8 100644 (file)
@@ -28,7 +28,7 @@ sub my_note {
 
     # work around problem where sub Test::More::note does not exist
     # in older versions of perl
-    if ($] >= 5.010) {
+    if ($] > 5.010) {
        note($msg);
     }
     return;