]> git.donarmstrong.com Git - perltidy.git/commitdiff
bump to v20240202.01 20240202.01
authorSteve Hancock <perltidy@users.sourceforge.net>
Fri, 9 Feb 2024 01:58:26 +0000 (17:58 -0800)
committerSteve Hancock <perltidy@users.sourceforge.net>
Fri, 9 Feb 2024 01:58:26 +0000 (17:58 -0800)
20 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

index daa238f28c19ac4f963f5099507a3dde4696862e..122432b7ee3ad07d420c6504030a124fcfc47a6a 100644 (file)
@@ -1,5 +1,24 @@
 # Perltidy Change Log
 
+## 2024 02 02.01
+
+    - 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)
+
+        return $self->{'commandline'}->{'arg_list'}->[0]->[0]->{'hostgroups'};
+
+        # perltidy -dia gives:
+        return $self->{'commandline'}{'arg_list'}[0][0]{'hostgroups'};
+
+      Added the opposite control --aia-interbracket-arrows, or -aia, to
+      add arrows. So applied to the previous line the arrows are restored:
+
+        # perltidy -aia
+        return $self->{'commandline'}->{'arg_list'}->[0]->[0]->{'hostgroups'};
+
+     The manual describes additional controls for selective adding and deleting.
+
 ## 2024 02 02
 
     - Added --valign-signed-numbers, or -vsn. This improves the appearance
       has also been added.  The next item, RT#130297, insures that the script
       will exit with a non-zero exit flag if the assertion fails.
 
-    - fixed issue RT#130297; the perltidy script now exits with a nonzero exit 
+    - fixed issue RT#130297; the perltidy script now exits with a nonzero exit
       status if it wrote to the standard error output. Prevously only fatal
       run errors produced a non-zero exit flag. Now, even non-fatal messages
       requested with the -w flag will cause a non-zero exit flag.  The exit
index b7f29df4f35c256eeef5ea560649afc5f5e05059..61d53e0fc06d15392f8f02c93c411bad7842c462 100755 (executable)
@@ -6414,7 +6414,7 @@ The perltidy binary uses the Perl::Tidy module and is installed when that module
 
 =head1 VERSION
 
-This man page documents perltidy version 20240202
+This man page documents perltidy version 20240202.01
 
 =head1 BUG REPORTS
 
index 4cbb3c0be215ce3835f68528ca566119dd1cf159..06bb8f698f8ed6afabd94497937c00bb8f043c88 100644 (file)
@@ -1,5 +1,25 @@
 <h1>Perltidy Change Log</h1>
 
+<h2>2024 02 02.01</h2>
+
+<pre><code>- 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)
+
+    return $self-&gt;{'commandline'}-&gt;{'arg_list'}-&gt;[0]-&gt;[0]-&gt;{'hostgroups'};
+
+    # perltidy -dia gives:
+    return $self-&gt;{'commandline'}{'arg_list'}[0][0]{'hostgroups'};
+
+  Added the opposite control --aia-interbracket-arrows, or -aia, to
+  add arrows. So applied to the previous line the arrows are restored:
+
+    # perltidy -aia
+    return $self-&gt;{'commandline'}-&gt;{'arg_list'}-&gt;[0]-&gt;[0]-&gt;{'hostgroups'};
+
+ The manual describes additional controls for selective adding and deleting.
+</code></pre>
+
 <h2>2024 02 02</h2>
 
 <pre><code>- Added --valign-signed-numbers, or -vsn. This improves the appearance
@@ -1359,7 +1379,7 @@ signatures.  Reformatting with the current version will fix the problem.
   has also been added.  The next item, RT#130297, insures that the script
   will exit with a non-zero exit flag if the assertion fails.
 
-- fixed issue RT#130297; the perltidy script now exits with a nonzero exit 
+- fixed issue RT#130297; the perltidy script now exits with a nonzero exit
   status if it wrote to the standard error output. Prevously only fatal
   run errors produced a non-zero exit flag. Now, even non-fatal messages
   requested with the -w flag will cause a non-zero exit flag.  The exit
index 86b73c948fd0487e4d3d911a4517601d52d8d0e7..ee566e75d3f5d99fd83600c144d45a8855dc607c 100644 (file)
 
 <h1 id="VERSION">VERSION</h1>
 
-<p>This man page documents Perl::Tidy version 20240202</p>
+<p>This man page documents Perl::Tidy version 20240202.01</p>
 
 <h1 id="LICENSE">LICENSE</h1>
 
index 310d993cc52cc862a15ba8e9d9ec9a9280e236b9..4ec28cfe5d5012eafcb357e4381b35f344df4750 100644 (file)
@@ -35,6 +35,7 @@
       <li><a href="#Breaking-Before-or-After-Operators">Breaking Before or After Operators</a></li>
       <li><a href="#Controlling-List-Formatting">Controlling List Formatting</a></li>
       <li><a href="#Adding-and-Deleting-Commas">Adding and Deleting Commas</a></li>
+      <li><a href="#Adding-and-Deleting-Interbracket-Arrows">Adding and Deleting Interbracket Arrows</a></li>
       <li><a href="#Missing-Else-Blocks">Missing Else Blocks</a></li>
       <li><a href="#Retaining-or-Ignoring-Existing-Line-Breaks">Retaining or Ignoring Existing Line Breaks</a></li>
       <li><a href="#Blank-Line-Control">Blank Line Control</a></li>
 </dd>
 </dl>
 
+<h2 id="Adding-and-Deleting-Interbracket-Arrows">Adding and Deleting Interbracket Arrows</h2>
+
+<p>In the following expression, the arrow operator &#39;-&gt;&#39; between the closing and opening brackets of hash keys and array indexes are optional:</p>
+
+<pre><code>   return $self-&gt;{&#39;commandline&#39;}-&gt;{&#39;arg_list&#39;}-&gt;[0]-&gt;[0]-&gt;{&#39;hostgroups&#39;};</code></pre>
+
+<p>These will be called <b>interbracket arrows</b> here, for lack of a better term. Perltidy will not change them by default, but they can be added or removed with the following parameters.</p>
+
+<dl>
+
+<dt id="dia---delete-interbracket-arrows"><b>-dia</b>, <b>--delete-interbracket-arrows</b></dt>
+<dd>
+
+<p>This parameter deletes interbracket arrows. Applied to the above example we have</p>
+
+<pre><code>    # perltidy -dia
+    return $self-&gt;{&#39;commandline&#39;}{&#39;arg_list&#39;}[0][0]{&#39;hostgroups&#39;};</code></pre>
+
+<p>By default this applies to all interbracket arrows, but selective deletion is possible with controls described below.</p>
+
+</dd>
+<dt id="aia---add-interbracket-arrows"><b>-aia</b>, <b>--add-interbracket-arrows</b></dt>
+<dd>
+
+<p>This parameter adds interbracket arrows. Applied to the line of code above, we get back the original line.</p>
+
+<pre><code>    # perltidy -aia
+    return $self-&gt;{&#39;commandline&#39;}-&gt;{&#39;arg_list&#39;}-&gt;[0]-&gt;[0]-&gt;{&#39;hostgroups&#39;};</code></pre>
+
+<p>Selective changes can be made with controls described below.</p>
+
+</dd>
+<dt id="ias-s---interbracket-arrow-style-s"><b>-ias=s</b>, <b>--interbracket-arrow-style=s</b></dt>
+<dd>
+
+<p>By default the <b>-add-</b> and <b>-delete-</b> parameters apply to all interbracket arrows.</p>
+
+<p>An optional style can be specified with this parameter string <b>s</b>. In that case the parameters <b>--add-interbracket-arrows</b> and <b>--delete-interbracket-arrows</b> only apply where they would bring the formatting into agreement with the specified style. They may both be used in a single run if a mixed style is specified since there is no conflict.</p>
+
+<p>The style string <b>s</b> gives a graphical description of the desired style. It lists up to four possible pairs of bracket types with an optional arrow between them. For example:</p>
+
+<pre><code>   -ias=&#39;][   }-&gt;{&#39;</code></pre>
+
+<p>This means no arrows are wanted between &#39;][&#39; but arrows should be between &#39;}{&#39;. And it means that the unlisted pairs &#39;]{&#39; and &#39;}[&#39; should remain unchanged, either with or without arrows.</p>
+
+<p>In this particular example, if the parameter <b>--delete-interbracket-arrows</b> is used, then only arrows like &#39;]-&gt;[&#39; will be deleted, since they are the only ones which disagree with the style.</p>
+
+<p>And likewise, if <b>--add-interbracket-arrows</b> is used, then arrows will only be inserted between brackets like &#39;}{&#39; to bring the formatting into conformity with the style in this example.</p>
+
+<p>Spaces in the string <b>s</b> are optional. They are ignored when the expression is parsed.</p>
+
+<p>The style corresponding to all possible arrows is</p>
+
+<pre><code>      -ias=&#39;]-&gt;[ ]-&gt;{ }-&gt;[ }-&gt;{&#39;</code></pre>
+
+<p>For convenience, this may also be requested with <b>-ias=1</b> or <b>-ias=&#39;*&#39;</b>.</p>
+
+<p>The style corresponding to no interbracket arrows is</p>
+
+<pre><code>      -ias=&#39;]  [ ]  { }  [ }  {&#39;</code></pre>
+
+<p>which may also be requested with <b>-ias=0</b>.</p>
+
+</dd>
+<dt id="wia---warn-interbracket-arrows"><b>-wia</b>, <b>--warn-interbracket-arrows</b></dt>
+<dd>
+
+<p>If this parameter is set, then a message is written to the error file in the following cases:</p>
+
+<ul>
+
+<li><p>If an arrow is added or deleted by an add or delete command.</p>
+
+</li>
+<li><p>If a style is defined and an arrow would have been added or deleted if requested. So for example, the command</p>
+
+<pre><code>   perltidy -wia -ias=&#39;][&#39;</code></pre>
+
+<p>will show where a file has arrows like ]-&gt;[&#39; since they do not match the style, but no changes will be made because the delete command <b>-dia</b> has not been given. And</p>
+
+<pre><code>   perltidy -wia -ias=0</code></pre>
+
+<p>will warn if any arrows exist, since the flag -ias=0 means that no arrows are wanted.</p>
+
+</li>
+</ul>
+
+</dd>
+<dt id="iac-n---interbracket-arrow-complexity-n"><b>-iac=n</b>, <b>--interbracket-arrow-complexity=n</b></dt>
+<dd>
+
+<p>This parameter makes it possible to skip adding or deleting arrows following a container which is complex in some sense. Three levels of complexity can be specified with the integer <b>n</b>, as follows:</p>
+
+<pre><code>   n=0   the contents of the left container must be a single thing (token)
+   n=1   the left container must not contain other containers [DEFAULT]
+   n=2   the left container may contain anything</code></pre>
+
+<p>Some examples:</p>
+
+<pre><code>    # Container                complexity
+    {&#39;commandline&#39;}            0 single token         OK by default
+    { $type . $name }          1 multiple tokens      OK by default
+    [ $plot{&#39;x-axis&#39;} - 1 ]    2 contains a container SKIPPED by default</code></pre>
+
+<p>So, with the default complexity level of 1, an arrow could be added or deleted following the first two of these containers but not the third.</p>
+
+</dd>
+</dl>
+
+<p><b>Some points to consider</b> when working with these parameters are:</p>
+
+<ul>
+
+<li><p>There are no known bugs, but this is a relatively new feature. So please carefully check file differences and run tests when interbracket arrows are added or removed.</p>
+
+</li>
+<li><p>For some unusual spacing parameters, it could take an extra iteration for the spaces between brackets to reach their final state after arrows are added or deleted.</p>
+
+</li>
+<li><p>Any comments between brackets will prevent the adding and deleting of arrows.</p>
+
+</li>
+</ul>
+
 <h2 id="Missing-Else-Blocks">Missing Else Blocks</h2>
 
 <p>A defensive programming technique is to require that every <b>if-elsif-</b> chain be terminated with an <b>else</b> block, even though it is not strictly required. This helps insure that there are no holes in the logic.</p>
 <dt id="bbs---blanks-before-subs"><b>-bbs</b>, <b>--blanks-before-subs</b></dt>
 <dd>
 
-<p>For compatibility with previous versions, <b>-bbs</b> or <b>--blanks-before-subs</b> is equivalent to <i>-blbp=1</i> and <i>-blbs=1</i>.</p>
+<p>For compatibility with previous versions, <b>-bbs</b> or <b>--blanks-before-subs</b> is equivalent to <b>-blbp=1</b> and <b>-blbs=1</b>.</p>
 
-<p>Likewise, <b>-nbbs</b> or <b>--noblanks-before-subs</b> is equivalent to <i>-blbp=0</i> and <i>-blbs=0</i>.</p>
+<p>Likewise, <b>-nbbs</b> or <b>--noblanks-before-subs</b> is equivalent to <b>-blbp=0</b> and <b>-blbs=0</b>.</p>
 
 </dd>
 <dt id="bbb---blanks-before-blocks"><b>-bbb</b>, <b>--blanks-before-blocks</b></dt>
 
 <p>The following list shows all short parameter names which allow a prefix &#39;n&#39; to produce the negated form:</p>
 
-<pre><code> D      ame    anl    asbl   asc    ast    asu    atc    atnl   aws
- b      baa    baao   bar    bbao   bbb    bbc    bbs    bl     bli
- boa    boc    bok    bol    bom    bos    bot    cblx   ce     conv
- cpb    cs     csc    cscb   cscw   dac    dbc    dbs    dcbl   dcsc
- ddf    dior   dln    dmcp   dnl    dop    dp     dpro   drc    dsc
- dsm    dsn    dtc    dtt    duv    dwic   dwls   dwrs   dws    eos
- f      fpva   frm    fs     fso    gcs    hbc    hbcm   hbco   hbh
- hbhh   hbi    hbj    hbk    hbm    hbn    hbp    hbpd   hbpu   hbq
- hbs    hbsc   hbv    hbw    hent   hic    hicm   hico   hih    hihh
- hii    hij    hik    him    hin    hip    hipd   hipu   hiq    his
- hisc   hiv    hiw    hsc    html   ibc    icb    icp    iob    ipc
- isbc   iscl   kgb    kgbd   kgbi   kis    lal    log    lop    lp
- lsl    mem    nib    ohbr   okw    ola    olc    oll    olq    opr
- opt    osbc   osbr   otr    ple    pod    pvl    q      sac    sbc
- sbl    scbb   schb   scp    scsb   sct    se     sfp    sfs    skp
- sob    sobb   sohb   sop    sosb   sot    ssc    st     sts    t
tac    tbc    toc    tp     tqw    trp    ts     tsc    tso    vbc
- vc     viu    vmll   vsc    vsn    w      wfc    wme    wn     x
- xbt    xci    xlp    xs</code></pre>
+<pre><code> D      aia    ame    anl    asbl   asc    ast    asu    atc    atnl
+ aws    b      baa    baao   bar    bbao   bbb    bbc    bbs    bl
+ bli    boa    boc    bok    bol    bom    bos    bot    cblx   ce
+ conv   cpb    cs     csc    cscb   cscw   dac    dbc    dbs    dcbl
+ dcsc   ddf    dia    dior   dln    dmcp   dnl    dop    dp     dpro
+ drc    dsc    dsm    dsn    dtc    dtt    duv    dwic   dwls   dwrs
+ dws    eos    f      fpva   frm    fs     fso    gcs    hbc    hbcm
+ hbco   hbh    hbhh   hbi    hbj    hbk    hbm    hbn    hbp    hbpd
+ hbpu   hbq    hbs    hbsc   hbv    hbw    hent   hic    hicm   hico
+ hih    hihh   hii    hij    hik    him    hin    hip    hipd   hipu
+ hiq    his    hisc   hiv    hiw    hsc    html   ibc    icb    icp
+ iob    ipc    isbc   iscl   kgb    kgbd   kgbi   kis    lal    log
+ lop    lp     lsl    mem    nib    ohbr   okw    ola    olc    oll
+ olq    opr    opt    osbc   osbr   otr    ple    pod    pvl    q
+ sac    sbc    sbl    scbb   schb   scp    scsb   sct    se     sfp
+ sfs    skp    sob    sobb   sohb   sop    sosb   sot    ssc    st
sts    t      tac    tbc    toc    tp     tqw    trp    ts     tsc
+ tso    vbc    vc     viu    vmll   vsc    vsn    w      wfc    wia
wme    wn     x      xbt    xci    xlp    xs</code></pre>
 
 <p>Equivalently, the prefix &#39;no&#39; or &#39;no-&#39; on the corresponding long names may be used.</p>
 
 
 <h1 id="VERSION">VERSION</h1>
 
-<p>This man page documents perltidy version 20240202</p>
+<p>This man page documents perltidy version 20240202.01</p>
 
 <h1 id="BUG-REPORTS">BUG REPORTS</h1>
 
index 9a8f2cde99e1e3752a2106fe384f2ae655c7bb46..0d7c63deb57811855d87aaa80663832f4000cdbf 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';
+    $VERSION = '20240202.01';
 } ## end BEGIN
 
 sub DESTROY {
index a8861dc0d826dad1a5a5a153dfc03f4d6a02b48c..9c690ef692e8c079919882f29f956091aa712710 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
+This man page documents Perl::Tidy version 20240202.01
 
 =head1 LICENSE
 
index 78614631b926f5bf4f1afb6d5bb0ceed6fd9a025..9f23e2fe8ba37fe15126d6982aaecb4c6d49a22d 100644 (file)
@@ -8,7 +8,7 @@ package Perl::Tidy::Debugger;
 use strict;
 use warnings;
 use English qw( -no_match_vars );
-our $VERSION = '20240202';
+our $VERSION = '20240202.01';
 
 use constant EMPTY_STRING => q{};
 use constant SPACE        => q{ };
index f1967824e3ab1867dd57947c8191d89e620ad554..fe84bf067eb41b831fcfd95eb24840f94d1bf632 100644 (file)
@@ -18,7 +18,7 @@ package Perl::Tidy::Diagnostics;
 use strict;
 use warnings;
 use English qw( -no_match_vars );
-our $VERSION = '20240202';
+our $VERSION = '20240202.01';
 
 use constant EMPTY_STRING => q{};
 
index 40e2888416c40938481d70473f248720f8b09238..fd3f4e324ea7a2ee2e7cdf59626f16a84fef256d 100644 (file)
@@ -16,7 +16,7 @@
 package Perl::Tidy::FileWriter;
 use strict;
 use warnings;
-our $VERSION = '20240202';
+our $VERSION = '20240202.01';
 
 use constant DEVEL_MODE   => 0;
 use constant EMPTY_STRING => q{};
index 2867fd850e6e57cd8288c64238d970d7b40663fb..3ecb5da5994e173c6133bf82802931b2c30e6f42 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';
+our $VERSION = '20240202.01';
 
 # The Tokenizer will be loaded with the Formatter
 ##use Perl::Tidy::Tokenizer;    # for is_keyword()
index ad870308d2794006ec05321675815673f975c18c..5a9a0adbd2e29ab443ef2669f6c12accae1e1e71 100644 (file)
@@ -7,7 +7,7 @@
 package Perl::Tidy::HtmlWriter;
 use strict;
 use warnings;
-our $VERSION = '20240202';
+our $VERSION = '20240202.01';
 
 use Carp;
 use English qw( -no_match_vars );
index 92a6c386d9b338f30534e98e0ada2ff3c1bc8aba..458954567b5cdb478e061158da88891c3609254a 100644 (file)
@@ -10,7 +10,7 @@ package Perl::Tidy::IOScalar;
 use strict;
 use warnings;
 use Carp;
-our $VERSION = '20240202';
+our $VERSION = '20240202.01';
 
 use constant DEVEL_MODE   => 0;
 use constant EMPTY_STRING => q{};
index 605161cf0aa9429fc8d101fa68023d7fcb5ebf6d..0d78787789727e2345c03c3d4ce8dc53f9957c6f 100644 (file)
@@ -14,7 +14,7 @@ package Perl::Tidy::IOScalarArray;
 use strict;
 use warnings;
 use Carp;
-our $VERSION = '20240202';
+our $VERSION = '20240202.01';
 
 use constant DEVEL_MODE => 0;
 
index 6a17661ad8729c1137d6e7ceacdbf326b6433690..b6d2fc10f443b561d348330bad0425f22e126d67 100644 (file)
@@ -9,7 +9,7 @@ package Perl::Tidy::IndentationItem;
 use strict;
 use warnings;
 
-our $VERSION = '20240202';
+our $VERSION = '20240202.01';
 
 BEGIN {
 
index 8131aae9159e0217b999e4b77c8affa2c6b7425a..6301109afb5569f8a2a84ee2c4e5a95efa5bda87 100644 (file)
@@ -8,7 +8,7 @@
 package Perl::Tidy::Logger;
 use strict;
 use warnings;
-our $VERSION = '20240202';
+our $VERSION = '20240202.01';
 use Carp;
 use English qw( -no_match_vars );
 
index f8e25c3d30be0c6060955e2e3d01f1f9844e92e3..96265d1a1b8b26e7a046403dd6cf3d4e3d5697da 100644 (file)
@@ -33,7 +33,7 @@ use strict;
 use warnings;
 use English qw( -no_match_vars );
 
-our $VERSION = '20240202';
+our $VERSION = '20240202.01';
 
 use Carp;
 
index fa4dcac4578541c918a9a310c6c8dffd53eac419..bc01ec6a3625fae4c2dc140911abea4115f9e2ee 100644 (file)
@@ -5,7 +5,7 @@ use Carp;
 
 { #<<< A non-indenting brace to contain all lexical variables
 
-our $VERSION = '20240202';
+our $VERSION = '20240202.01';
 use English qw( -no_match_vars );
 use Perl::Tidy::VerticalAligner::Alignment;
 use Perl::Tidy::VerticalAligner::Line;
index fe8c301fa8f8ce355e6a0cc3d0088b9281fabc8a..9c88cdd1fd4edd95888b37f165e61db784754ed6 100644 (file)
@@ -9,7 +9,7 @@ package Perl::Tidy::VerticalAligner::Alignment;
 use strict;
 use warnings;
 
-our $VERSION = '20240202';
+our $VERSION = '20240202.01';
 
 sub new {
     my ( $class, $rarg ) = @_;
index 75f4b37c44848ed8173c7242296cb0bbac3548ce..447a929df98ba807b526a3df2c2a79294e8bb742 100644 (file)
@@ -10,7 +10,7 @@ package Perl::Tidy::VerticalAligner::Line;
 use strict;
 use warnings;
 
-our $VERSION = '20240202';
+our $VERSION = '20240202.01';
 use English qw( -no_match_vars );
 
 sub AUTOLOAD {