From: Steve Hancock Date: Fri, 9 Feb 2024 01:58:26 +0000 (-0800) Subject: bump to v20240202.01 X-Git-Tag: 20240202.01^0 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=5a3c0987b5c5eaee9733b741439eca0b8f1d2ba9;p=perltidy.git bump to v20240202.01 --- diff --git a/CHANGES.md b/CHANGES.md index daa238f2..122432b7 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -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 @@ -1339,7 +1358,7 @@ 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 diff --git a/bin/perltidy b/bin/perltidy index b7f29df4..61d53e0f 100755 --- a/bin/perltidy +++ b/bin/perltidy @@ -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 diff --git a/docs/ChangeLog.html b/docs/ChangeLog.html index 4cbb3c0b..06bb8f69 100644 --- a/docs/ChangeLog.html +++ b/docs/ChangeLog.html @@ -1,5 +1,25 @@

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
@@ -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
diff --git a/docs/Tidy.html b/docs/Tidy.html
index 86b73c94..ee566e75 100644
--- a/docs/Tidy.html
+++ b/docs/Tidy.html
@@ -399,7 +399,7 @@
 
 

VERSION

-

This man page documents Perl::Tidy version 20240202

+

This man page documents Perl::Tidy version 20240202.01

LICENSE

diff --git a/docs/perltidy.html b/docs/perltidy.html index 310d993c..4ec28cfe 100644 --- a/docs/perltidy.html +++ b/docs/perltidy.html @@ -35,6 +35,7 @@
  • Breaking Before or After Operators
  • Controlling List Formatting
  • Adding and Deleting Commas
  • +
  • Adding and Deleting Interbracket Arrows
  • Missing Else Blocks
  • Retaining or Ignoring Existing Line Breaks
  • Blank Line Control
  • @@ -3102,6 +3103,130 @@ +

    Adding and Deleting Interbracket Arrows

    + +

    In the following expression, the arrow operator '->' between the closing and opening brackets of hash keys and array indexes are optional:

    + +
       return $self->{'commandline'}->{'arg_list'}->[0]->[0]->{'hostgroups'};
    + +

    These will be called interbracket arrows 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.

    + +
    + +
    -dia, --delete-interbracket-arrows
    +
    + +

    This parameter deletes interbracket arrows. Applied to the above example we have

    + +
        # perltidy -dia
    +    return $self->{'commandline'}{'arg_list'}[0][0]{'hostgroups'};
    + +

    By default this applies to all interbracket arrows, but selective deletion is possible with controls described below.

    + +
    +
    -aia, --add-interbracket-arrows
    +
    + +

    This parameter adds interbracket arrows. Applied to the line of code above, we get back the original line.

    + +
        # perltidy -aia
    +    return $self->{'commandline'}->{'arg_list'}->[0]->[0]->{'hostgroups'};
    + +

    Selective changes can be made with controls described below.

    + +
    +
    -ias=s, --interbracket-arrow-style=s
    +
    + +

    By default the -add- and -delete- parameters apply to all interbracket arrows.

    + +

    An optional style can be specified with this parameter string s. In that case the parameters --add-interbracket-arrows and --delete-interbracket-arrows 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.

    + +

    The style string s 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:

    + +
       -ias='][   }->{'
    + +

    This means no arrows are wanted between '][' but arrows should be between '}{'. And it means that the unlisted pairs ']{' and '}[' should remain unchanged, either with or without arrows.

    + +

    In this particular example, if the parameter --delete-interbracket-arrows is used, then only arrows like ']->[' will be deleted, since they are the only ones which disagree with the style.

    + +

    And likewise, if --add-interbracket-arrows is used, then arrows will only be inserted between brackets like '}{' to bring the formatting into conformity with the style in this example.

    + +

    Spaces in the string s are optional. They are ignored when the expression is parsed.

    + +

    The style corresponding to all possible arrows is

    + +
          -ias=']->[ ]->{ }->[ }->{'
    + +

    For convenience, this may also be requested with -ias=1 or -ias='*'.

    + +

    The style corresponding to no interbracket arrows is

    + +
          -ias=']  [ ]  { }  [ }  {'
    + +

    which may also be requested with -ias=0.

    + +
    +
    -wia, --warn-interbracket-arrows
    +
    + +

    If this parameter is set, then a message is written to the error file in the following cases:

    + +
      + +
    • If an arrow is added or deleted by an add or delete command.

      + +
    • +
    • If a style is defined and an arrow would have been added or deleted if requested. So for example, the command

      + +
         perltidy -wia -ias=']['
      + +

      will show where a file has arrows like ]->[' since they do not match the style, but no changes will be made because the delete command -dia has not been given. And

      + +
         perltidy -wia -ias=0
      + +

      will warn if any arrows exist, since the flag -ias=0 means that no arrows are wanted.

      + +
    • +
    + +
    +
    -iac=n, --interbracket-arrow-complexity=n
    +
    + +

    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 n, as follows:

    + +
       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
    + +

    Some examples:

    + +
        # Container                complexity
    +    {'commandline'}            0 single token         OK by default
    +    { $type . $name }          1 multiple tokens      OK by default
    +    [ $plot{'x-axis'} - 1 ]    2 contains a container SKIPPED by default
    + +

    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.

    + +
    +
    + +

    Some points to consider when working with these parameters are:

    + +
      + +
    • 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.

      + +
    • +
    • 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.

      + +
    • +
    • Any comments between brackets will prevent the adding and deleting of arrows.

      + +
    • +
    +

    Missing Else Blocks

    A defensive programming technique is to require that every if-elsif- chain be terminated with an else block, even though it is not strictly required. This helps insure that there are no holes in the logic.

    @@ -3438,9 +3563,9 @@
    -bbs, --blanks-before-subs
    -

    For compatibility with previous versions, -bbs or --blanks-before-subs is equivalent to -blbp=1 and -blbs=1.

    +

    For compatibility with previous versions, -bbs or --blanks-before-subs is equivalent to -blbp=1 and -blbs=1.

    -

    Likewise, -nbbs or --noblanks-before-subs is equivalent to -blbp=0 and -blbs=0.

    +

    Likewise, -nbbs or --noblanks-before-subs is equivalent to -blbp=0 and -blbs=0.

    -bbb, --blanks-before-blocks
    @@ -4788,25 +4913,25 @@

    The following list shows all short parameter names which allow a prefix 'n' to produce the negated form:

    -
     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
    +
     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

    Equivalently, the prefix 'no' or 'no-' on the corresponding long names may be used.

    @@ -4884,7 +5009,7 @@

    VERSION

    -

    This man page documents perltidy version 20240202

    +

    This man page documents perltidy version 20240202.01

    BUG REPORTS

    diff --git a/lib/Perl/Tidy.pm b/lib/Perl/Tidy.pm index 9a8f2cde..0d7c63de 100644 --- a/lib/Perl/Tidy.pm +++ b/lib/Perl/Tidy.pm @@ -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 { diff --git a/lib/Perl/Tidy.pod b/lib/Perl/Tidy.pod index a8861dc0..9c690ef6 100644 --- a/lib/Perl/Tidy.pod +++ b/lib/Perl/Tidy.pod @@ -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 diff --git a/lib/Perl/Tidy/Debugger.pm b/lib/Perl/Tidy/Debugger.pm index 78614631..9f23e2fe 100644 --- a/lib/Perl/Tidy/Debugger.pm +++ b/lib/Perl/Tidy/Debugger.pm @@ -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{ }; diff --git a/lib/Perl/Tidy/Diagnostics.pm b/lib/Perl/Tidy/Diagnostics.pm index f1967824..fe84bf06 100644 --- a/lib/Perl/Tidy/Diagnostics.pm +++ b/lib/Perl/Tidy/Diagnostics.pm @@ -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{}; diff --git a/lib/Perl/Tidy/FileWriter.pm b/lib/Perl/Tidy/FileWriter.pm index 40e28884..fd3f4e32 100644 --- a/lib/Perl/Tidy/FileWriter.pm +++ b/lib/Perl/Tidy/FileWriter.pm @@ -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{}; diff --git a/lib/Perl/Tidy/Formatter.pm b/lib/Perl/Tidy/Formatter.pm index 2867fd85..3ecb5da5 100644 --- a/lib/Perl/Tidy/Formatter.pm +++ b/lib/Perl/Tidy/Formatter.pm @@ -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() diff --git a/lib/Perl/Tidy/HtmlWriter.pm b/lib/Perl/Tidy/HtmlWriter.pm index ad870308..5a9a0adb 100644 --- a/lib/Perl/Tidy/HtmlWriter.pm +++ b/lib/Perl/Tidy/HtmlWriter.pm @@ -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 ); diff --git a/lib/Perl/Tidy/IOScalar.pm b/lib/Perl/Tidy/IOScalar.pm index 92a6c386..45895456 100644 --- a/lib/Perl/Tidy/IOScalar.pm +++ b/lib/Perl/Tidy/IOScalar.pm @@ -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{}; diff --git a/lib/Perl/Tidy/IOScalarArray.pm b/lib/Perl/Tidy/IOScalarArray.pm index 605161cf..0d787877 100644 --- a/lib/Perl/Tidy/IOScalarArray.pm +++ b/lib/Perl/Tidy/IOScalarArray.pm @@ -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; diff --git a/lib/Perl/Tidy/IndentationItem.pm b/lib/Perl/Tidy/IndentationItem.pm index 6a17661a..b6d2fc10 100644 --- a/lib/Perl/Tidy/IndentationItem.pm +++ b/lib/Perl/Tidy/IndentationItem.pm @@ -9,7 +9,7 @@ package Perl::Tidy::IndentationItem; use strict; use warnings; -our $VERSION = '20240202'; +our $VERSION = '20240202.01'; BEGIN { diff --git a/lib/Perl/Tidy/Logger.pm b/lib/Perl/Tidy/Logger.pm index 8131aae9..6301109a 100644 --- a/lib/Perl/Tidy/Logger.pm +++ b/lib/Perl/Tidy/Logger.pm @@ -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 ); diff --git a/lib/Perl/Tidy/Tokenizer.pm b/lib/Perl/Tidy/Tokenizer.pm index f8e25c3d..96265d1a 100644 --- a/lib/Perl/Tidy/Tokenizer.pm +++ b/lib/Perl/Tidy/Tokenizer.pm @@ -33,7 +33,7 @@ use strict; use warnings; use English qw( -no_match_vars ); -our $VERSION = '20240202'; +our $VERSION = '20240202.01'; use Carp; diff --git a/lib/Perl/Tidy/VerticalAligner.pm b/lib/Perl/Tidy/VerticalAligner.pm index fa4dcac4..bc01ec6a 100644 --- a/lib/Perl/Tidy/VerticalAligner.pm +++ b/lib/Perl/Tidy/VerticalAligner.pm @@ -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; diff --git a/lib/Perl/Tidy/VerticalAligner/Alignment.pm b/lib/Perl/Tidy/VerticalAligner/Alignment.pm index fe8c301f..9c88cdd1 100644 --- a/lib/Perl/Tidy/VerticalAligner/Alignment.pm +++ b/lib/Perl/Tidy/VerticalAligner/Alignment.pm @@ -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 ) = @_; diff --git a/lib/Perl/Tidy/VerticalAligner/Line.pm b/lib/Perl/Tidy/VerticalAligner/Line.pm index 75f4b37c..447a929d 100644 --- a/lib/Perl/Tidy/VerticalAligner/Line.pm +++ b/lib/Perl/Tidy/VerticalAligner/Line.pm @@ -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 {