]> git.donarmstrong.com Git - perltidy.git/commitdiff
-vsn is now default; bump version to .02 20240202.02
authorSteve Hancock <perltidy@users.sourceforge.net>
Sun, 18 Feb 2024 00:37:04 +0000 (16:37 -0800)
committerSteve Hancock <perltidy@users.sourceforge.net>
Sun, 18 Feb 2024 00:37:04 +0000 (16:37 -0800)
24 files changed:
CHANGES.md
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
t/snippets/expect/math1.def
t/snippets/expect/vsn.def
t/snippets29.t
t/snippets5.t

index 4ecc53fcf394b74c7ac31828a9921c05bdf3cfb7..a04f9c1276060134f357cf00ed8fea5372a61b91 100644 (file)
@@ -1,6 +1,12 @@
 # Perltidy Change Log
 
-## 2024 02 02.01
+## 2024 02 02.02
+
+    - 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
+      of vertically aligned numbers, and can be deactivated with -nvsn.
 
     - The option --delete-repeated-commas is now the default.
 
index c6853af99dfe628a62a5e84c1e2edfa6fa4fd84b..c78b65b96899631f7e1a1da2b5176d5411399c26 100755 (executable)
@@ -6446,7 +6446,7 @@ The perltidy binary uses the Perl::Tidy module and is installed when that module
 
 =head1 VERSION
 
-This man page documents perltidy version 20240202.01
+This man page documents perltidy version 20240202.02
 
 =head1 BUG REPORTS
 
index 06bb8f698f8ed6afabd94497937c00bb8f043c88..1cfaee633eab68fca5ba4374cd63d6d5e0f87aaa 100644 (file)
@@ -1,8 +1,26 @@
 <h1>Perltidy Change Log</h1>
 
-<h2>2024 02 02.01</h2>
+<h2>2024 02 02.02</h2>
 
-<pre><code>- Added control --delete-interbracket-arrows, or -dia, to delete optional
+<pre><code>- 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
+  of vertically aligned numbers, and can be deactivated with -nvsn.
+
+- The option --delete-repeated-commas is now the default.
+
+  It makes the following checks and changes:
+  - Repeated commas like ',,' are removed with a warning
+  - Repeated fat commas like '=&gt; =&gt;' are removed with a
+    warning
+  - The combination '=&gt;,' produces a warning but is not changed
+  These warnings are only output if --warning-output, or -w, is set.
+
+  This is now the DEFAULT Behavior.
+  Use --nodelete-repeated-commas, or -ndrc, to turn this option off.
+
+- Added control --delete-interbracket-arrows, or -dia, to delete optional
   hash ref and array ref arrows between brackets as in the following
   expression (see git #131)
 
index ee566e75d3f5d99fd83600c144d45a8855dc607c..a2431bebec2349af1f7cadf4623f5e89e74da000 100644 (file)
 
 <h1 id="VERSION">VERSION</h1>
 
-<p>This man page documents Perl::Tidy version 20240202.01</p>
+<p>This man page documents Perl::Tidy version 20240202.02</p>
 
 <h1 id="LICENSE">LICENSE</h1>
 
index 4ec28cfe5d5012eafcb357e4381b35f344df4750..2ce87b966de3cd0296db9cbd089cebb1968f905a 100644 (file)
 <pre><code>      # perltidy -drc:
       ignoreSpec( $file, &quot;file&quot;, \%spec, \%Rspec );</code></pre>
 
-<p>Since the default is not to add or delete commas, this feature is off by default and must be requested.</p>
+<p>This parameter also deletes repeated fat commas, &#39;=&gt;&#39;. The complete list of actions taken when this flag is set are as follows:</p>
+
+<ul>
+
+<li><p>Repeated commas like &#39;,,&#39; are removed with a warning.</p>
+
+</li>
+<li><p>Repeated fat commas like &#39;=&gt; =&gt;&#39; are removed with a warning.</p>
+
+</li>
+<li><p>The combination &#39;=&gt;,&#39; produces a warning but is not changed (it is likely an error but only its author would know how to fix it).</p>
+
+</li>
+<li><p>The remaining combination &#39;,=&gt;&#39; (sometimes called a &#39;winking fat comma&#39;) is ignored by this parameter.</p>
+
+</li>
+<li><p>These warnings are only output if the <b>--warning-output</b>, or <b>-w</b>, flag is set.</p>
+
+</li>
+</ul>
+
+<p>This feature is on by default. Use <b>-ndrc</b> to turn it off.</p>
 
 </dd>
 <dt id="want-trailing-commas-s-or--wtc-s---add-trailing-commas-or--atc-and---delete-trailing-commas-or--dtc"><b>--want-trailing-commas=s</b> or <b>-wtc=s</b>, <b>--add-trailing-commas</b> or <b>-atc</b>, and <b>--delete-trailing-commas</b> or <b>-dtc</b></dt>
 <dt id="r:-reused-variable-name"><b>r: reused variable name</b></dt>
 <dd>
 
-<p>These are variables which are re-declared in the scope of a variable with the identical name. This can be confusing (perhaps not when the code is first written, but possibly later during maintenance work). This issue can be avoided by renaming one of the conflicting variables. Note that this is similar to the <b>Perl::Critic</b> policy <b>Variables::ProhibitReusedNames</b>.</p>
+<p>These are variables which are re-declared in the scope of a variable with the identical name. This can be confusing, perhaps not when the code is first written, but possibly later during maintenance work. For example, this can make it difficult to locate the correct variable with an editor when changes are being made. This issue can be avoided by renaming one of the conflicting variables. Note that this is similar to the <b>Perl::Critic</b> policy <b>Variables::ProhibitReusedNames</b>.</p>
 
 </dd>
 <dt id="s:-sigil-change-but-reused-bareword"><b>s: sigil change but reused bareword</b></dt>
 <dt id="u:-unused-variables"><b>u: unused variables</b></dt>
 <dd>
 
-<p>These are variables which are declared with a <code>my</code> and not referenced again within their scope. Calling them <b>unused</b> is convenient but not really accurate; this is a &quot;gray area&quot; for a program. There are many reasons for having such variables. For example, they might occur in a list of values provided by another routine or data structure, and therefore must be listed, even though they might not be referenced again. Or they might be defined for possible future program development, clarity or debugging. <b>But</b> sometimes they can occur due to being orphaned by a coding change, due to a misspelling, or by having an unintentional preceding <code>my</code>. So it is worth reviewing them, especially for new code. Here is an example of an unused variable in a script located with this method:</p>
+<p>These are variables which are declared with a <code>my</code> and not referenced again within their scope. Calling them <b>unused</b> is convenient but not really accurate; this is a &quot;gray area&quot; for a program. There are some good reasons for having such variables. For example, they might occur in a list of values provided by another routine or data structure, and therefore must be listed, even though they might not be referenced again. Having such variables can make them immediately available for future development and debugging, and can be beneficial for program clarity.</p>
+
+<p><b>But</b> sometimes they can occur due to being orphaned by a coding change, due to a misspelling, or by having an unintentional preceding <code>my</code>. So it is worth reviewing them, especially for new code. Here is an example of an unused variable in a script located with this method:</p>
 
 <pre><code>   BEGIN { my $string = &quot;&quot; }
    ...
    $string .= &quot;ok&quot;;</code></pre>
 
-<p>This looks nice at first glance, but the scope of the <code>my</code> declaration is limited to the surrounding braces, so it is not the same variable as the other <code>$string</code> and must therefore be reported as unused. This problem would have also been caught by perl if the author had used <code>strict</code>.</p>
+<p>This looks nice at first glance, but the scope of the <code>my</code> declaration is limited to the surrounding braces, so it is not the same variable as the other <code>$string</code> and must therefore be reported as unused. This particular problem would have also been caught by perl if the author had used <code>strict</code>.</p>
 
 </dd>
 </dl>
 
 <h1 id="VERSION">VERSION</h1>
 
-<p>This man page documents perltidy version 20240202.01</p>
+<p>This man page documents perltidy version 20240202.02</p>
 
 <h1 id="BUG-REPORTS">BUG REPORTS</h1>
 
index b8abb0a0a51ef35be34367747e366925de3b263d..622b22d18fb0fc9b70e4041217764984b0097d01 100644 (file)
@@ -131,7 +131,7 @@ BEGIN {
     # then the Release version must be bumped, and it is probably past time for
     # a release anyway.
 
-    $VERSION = '20240202.01';
+    $VERSION = '20240202.02';
 } ## end BEGIN
 
 sub DESTROY {
@@ -3887,6 +3887,7 @@ sub generate_options {
       valign-code
       valign-block-comments
       valign-side-comments
+      valign-signed-numbers
       valign-signed-numbers-limit=20
       short-concatenation-item-length=8
       space-for-semicolon
index 9c690ef692e8c079919882f29f956091aa712710..19c7c81abe75f059996b93af123f4aa5b7013978 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 20240202.01
+This man page documents Perl::Tidy version 20240202.02
 
 =head1 LICENSE
 
index 9f23e2fe8ba37fe15126d6982aaecb4c6d49a22d..9f245bac528e0a58059a323c8418cb296d302b90 100644 (file)
@@ -8,7 +8,7 @@ package Perl::Tidy::Debugger;
 use strict;
 use warnings;
 use English qw( -no_match_vars );
-our $VERSION = '20240202.01';
+our $VERSION = '20240202.02';
 
 use constant EMPTY_STRING => q{};
 use constant SPACE        => q{ };
index fe84bf067eb41b831fcfd95eb24840f94d1bf632..c1bdc27bada535ae9a0b74e56c537582619ff8ef 100644 (file)
@@ -18,7 +18,7 @@ package Perl::Tidy::Diagnostics;
 use strict;
 use warnings;
 use English qw( -no_match_vars );
-our $VERSION = '20240202.01';
+our $VERSION = '20240202.02';
 
 use constant EMPTY_STRING => q{};
 
index fd3f4e324ea7a2ee2e7cdf59626f16a84fef256d..92a69aad28cab332b21b7d2f0e598d233c488403 100644 (file)
@@ -16,7 +16,7 @@
 package Perl::Tidy::FileWriter;
 use strict;
 use warnings;
-our $VERSION = '20240202.01';
+our $VERSION = '20240202.02';
 
 use constant DEVEL_MODE   => 0;
 use constant EMPTY_STRING => q{};
index 7393537d2ea07fd21e7ceca90788e7340d14bcc9..c428237000e7c680b9059d209561eb22b9cf270c 100644 (file)
@@ -75,7 +75,7 @@ use constant SPACE        => 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.01';
+our $VERSION = '20240202.02';
 
 # The Tokenizer will be loaded with the Formatter
 ##use Perl::Tidy::Tokenizer;    # for is_keyword()
index 5a9a0adbd2e29ab443ef2669f6c12accae1e1e71..af1e5194b190beaf9d42a2cc04d851383cf242e8 100644 (file)
@@ -7,7 +7,7 @@
 package Perl::Tidy::HtmlWriter;
 use strict;
 use warnings;
-our $VERSION = '20240202.01';
+our $VERSION = '20240202.02';
 
 use Carp;
 use English qw( -no_match_vars );
index 458954567b5cdb478e061158da88891c3609254a..9006e755f4b40ab6b9a794f1fc49f64fcbc839d4 100644 (file)
@@ -10,7 +10,7 @@ package Perl::Tidy::IOScalar;
 use strict;
 use warnings;
 use Carp;
-our $VERSION = '20240202.01';
+our $VERSION = '20240202.02';
 
 use constant DEVEL_MODE   => 0;
 use constant EMPTY_STRING => q{};
index 0d78787789727e2345c03c3d4ce8dc53f9957c6f..418ec88fde1d84efeb17fb8e4ebcc2302c5810bf 100644 (file)
@@ -14,7 +14,7 @@ package Perl::Tidy::IOScalarArray;
 use strict;
 use warnings;
 use Carp;
-our $VERSION = '20240202.01';
+our $VERSION = '20240202.02';
 
 use constant DEVEL_MODE => 0;
 
index b6d2fc10f443b561d348330bad0425f22e126d67..c9a95069d5b742e0353e73487664140e7e962177 100644 (file)
@@ -9,7 +9,7 @@ package Perl::Tidy::IndentationItem;
 use strict;
 use warnings;
 
-our $VERSION = '20240202.01';
+our $VERSION = '20240202.02';
 
 BEGIN {
 
index 6301109afb5569f8a2a84ee2c4e5a95efa5bda87..8759498889bfbb97624714d9723fb4888209579e 100644 (file)
@@ -8,7 +8,7 @@
 package Perl::Tidy::Logger;
 use strict;
 use warnings;
-our $VERSION = '20240202.01';
+our $VERSION = '20240202.02';
 use Carp;
 use English qw( -no_match_vars );
 
@@ -105,7 +105,7 @@ sub new {
         _complaint_count               => 0,
         _is_encoded_data               => $is_encoded_data,
         _saw_code_bug      => -1,                    # -1=no 0=maybe 1=for sure
-        _saw_brace_error   => 0,
+        _saw_brace_error   =>  0,
         _output_array      => [],
         _input_stream_name => $input_stream_name,
         _filename_stamp    => $filename_stamp,
index b7cc49fae69a186e4a855ed0380bd950edb1eb69..a130b81fbd76ecd67bf9ee4bd6bd09db34f39e83 100644 (file)
@@ -33,7 +33,7 @@ use strict;
 use warnings;
 use English qw( -no_match_vars );
 
-our $VERSION = '20240202.01';
+our $VERSION = '20240202.02';
 
 use Carp;
 
index d49153537421c1ff43f087840a3ae52f6974fc51..897475a1eb7482d026860a5859c38bf4f1b786ba 100644 (file)
@@ -5,7 +5,7 @@ use Carp;
 
 { #<<< A non-indenting brace to contain all lexical variables
 
-our $VERSION = '20240202.01';
+our $VERSION = '20240202.02';
 use English qw( -no_match_vars );
 use Perl::Tidy::VerticalAligner::Alignment;
 use Perl::Tidy::VerticalAligner::Line;
index 9c88cdd1fd4edd95888b37f165e61db784754ed6..a88cc800f66a132e8c0cead2e482ebbc5fd9b8f2 100644 (file)
@@ -9,7 +9,7 @@ package Perl::Tidy::VerticalAligner::Alignment;
 use strict;
 use warnings;
 
-our $VERSION = '20240202.01';
+our $VERSION = '20240202.02';
 
 sub new {
     my ( $class, $rarg ) = @_;
index 447a929df98ba807b526a3df2c2a79294e8bb742..fc29e0859636bb9d94ec8f185196ae5eb2674964 100644 (file)
@@ -10,7 +10,7 @@ package Perl::Tidy::VerticalAligner::Line;
 use strict;
 use warnings;
 
-our $VERSION = '20240202.01';
+our $VERSION = '20240202.02';
 use English qw( -no_match_vars );
 
 sub AUTOLOAD {
index 7d5fe39965fbf06c4601307042f2a57deb95bf9b..4cc08de7af912984c69a6837b1e48db6fcc29191 100644 (file)
@@ -1,10 +1,10 @@
 my $xyz_shield = [
     [ -0.060,  -0.060,  0. ],
-    [ 0.060,   -0.060,  0. ],
-    [ 0.060,   0.060,   0. ],
-    [ -0.060,  0.060,   0. ],
+    [  0.060,  -0.060,  0. ],
+    [  0.060,   0.060,  0. ],
+    [ -0.060,   0.060,  0. ],
     [ -0.0925, -0.0925, 0.092 ],
-    [ 0.0925,  -0.0925, 0.092 ],
-    [ 0.0925,  0.0925,  0.092 ],
-    [ -0.0925, 0.0925,  0.092 ],
+    [  0.0925, -0.0925, 0.092 ],
+    [  0.0925,  0.0925, 0.092 ],
+    [ -0.0925,  0.0925, 0.092 ],
 ];
index d2f785c3ea58c4b313f4d407ee398c15e8f18bfb..23d169127b41c8102b882a08305ed55d1446d36d 100644 (file)
@@ -1,12 +1,12 @@
 @data = (
     [ "1st", "2nd", "3rd", "4th", "5th", "6th", "7th", "8th", "9th" ],
-    [ 1,     2,     5,     6,     3,     1.5,   -1,    -3,    -4 ],
-    [ -4,    -3,    1,     1,     -3,    -1.5,  -2,    -1,    0 ],
-    [ 9,     8,     9,     8.4,   7.1,   7.5,   8,     3,     -3 ],
-    [ 0.1,   0.2,   0.5,   0.4,   0.3,   0.5,   0.1,   0,     0.4 ],
+    [  1,     2,    5,     6,      3,     1.5,  -1,    -3,    -4 ],
+    [ -4,    -3,    1,     1,     -3,    -1.5,  -2,    -1,     0 ],
+    [  9,     8,    9,     8.4,    7.1,   7.5,   8,     3,    -3 ],
+    [  0.1,   0.2,  0.5,   0.4,    0.3,   0.5,   0.1,   0,     0.4 ],
 );
 
-$s->drawLine( 35,  0 );
-$s->drawLine( 0,   10 );
-$s->drawLine( -35, 0 );
-$s->drawLine( 0,   -10 );
+$s->drawLine(  35,  0 );
+$s->drawLine(  0,   10 );
+$s->drawLine( -35,  0 );
+$s->drawLine(  0,  -10 );
index 64c55bd26fea6e9f0d24b343cc4150981dda55f7..cfe5767ba992860102362d691f8d7b6f72f170a1 100644 (file)
@@ -109,16 +109,16 @@ sub Sub( $x, $y );
             expect => <<'#2...........',
 @data = (
     [ "1st", "2nd", "3rd", "4th", "5th", "6th", "7th", "8th", "9th" ],
-    [ 1,     2,     5,     6,     3,     1.5,   -1,    -3,    -4 ],
-    [ -4,    -3,    1,     1,     -3,    -1.5,  -2,    -1,    0 ],
-    [ 9,     8,     9,     8.4,   7.1,   7.5,   8,     3,     -3 ],
-    [ 0.1,   0.2,   0.5,   0.4,   0.3,   0.5,   0.1,   0,     0.4 ],
+    [  1,     2,    5,     6,      3,     1.5,  -1,    -3,    -4 ],
+    [ -4,    -3,    1,     1,     -3,    -1.5,  -2,    -1,     0 ],
+    [  9,     8,    9,     8.4,    7.1,   7.5,   8,     3,    -3 ],
+    [  0.1,   0.2,  0.5,   0.4,    0.3,   0.5,   0.1,   0,     0.4 ],
 );
 
-$s->drawLine( 35,  0 );
-$s->drawLine( 0,   10 );
-$s->drawLine( -35, 0 );
-$s->drawLine( 0,   -10 );
+$s->drawLine(  35,  0 );
+$s->drawLine(  0,   10 );
+$s->drawLine( -35,  0 );
+$s->drawLine(  0,  -10 );
 #2...........
         },
 
index 3ada90170da587d13eac1a6392d05e952fbc178c..f1cde6c2504fb85482e6489ee23cdb1cf12ddc6e 100644 (file)
@@ -810,13 +810,13 @@ print JUNK ("<","&",">")[rand(3)];# make these a bit more likely
             expect => <<'#12...........',
 my $xyz_shield = [
     [ -0.060,  -0.060,  0. ],
-    [ 0.060,   -0.060,  0. ],
-    [ 0.060,   0.060,   0. ],
-    [ -0.060,  0.060,   0. ],
+    [  0.060,  -0.060,  0. ],
+    [  0.060,   0.060,  0. ],
+    [ -0.060,   0.060,  0. ],
     [ -0.0925, -0.0925, 0.092 ],
-    [ 0.0925,  -0.0925, 0.092 ],
-    [ 0.0925,  0.0925,  0.092 ],
-    [ -0.0925, 0.0925,  0.092 ],
+    [  0.0925, -0.0925, 0.092 ],
+    [  0.0925,  0.0925, 0.092 ],
+    [ -0.0925,  0.0925, 0.092 ],
 ];
 #12...........
         },