From c0bc3906ee7ad5cb355b44d307812e178c89307b Mon Sep 17 00:00:00 2001 From: Steve Hancock Date: Sun, 10 Jan 2021 06:18:50 -0800 Subject: [PATCH] update VERSION to 20210111 --- CHANGES.md | 52 +- bin/perltidy | 53 +- dev-bin/perltidy_random_run.pl | 18 +- docs/BugLog.html | 663 ++++++++++++++++++++- docs/ChangeLog.html | 61 +- docs/Tidy.html | 2 +- docs/perltidy.html | 48 +- lib/Perl/Tidy.pm | 10 +- lib/Perl/Tidy.pod | 2 +- lib/Perl/Tidy/Debugger.pm | 2 +- lib/Perl/Tidy/DevNull.pm | 2 +- lib/Perl/Tidy/Diagnostics.pm | 2 +- lib/Perl/Tidy/FileWriter.pm | 2 +- lib/Perl/Tidy/Formatter.pm | 4 +- lib/Perl/Tidy/HtmlWriter.pm | 2 +- lib/Perl/Tidy/IOScalar.pm | 2 +- lib/Perl/Tidy/IOScalarArray.pm | 2 +- lib/Perl/Tidy/IndentationItem.pm | 2 +- lib/Perl/Tidy/LineBuffer.pm | 2 +- lib/Perl/Tidy/LineSink.pm | 2 +- lib/Perl/Tidy/LineSource.pm | 2 +- lib/Perl/Tidy/Logger.pm | 2 +- lib/Perl/Tidy/Tokenizer.pm | 4 +- lib/Perl/Tidy/VerticalAligner.pm | 14 +- lib/Perl/Tidy/VerticalAligner/Alignment.pm | 2 +- lib/Perl/Tidy/VerticalAligner/Line.pm | 2 +- local-docs/BugLog.pod | 10 +- 27 files changed, 890 insertions(+), 79 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index d195cc92..066c3fb3 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,24 +1,60 @@ # Perltidy Change Log -## 2020 12 07 xx +## 2021 01 11 - - Fixed issue git #51, in which closing qw pattern delimiters not always + - Fixed issue git #49, -se breaks warnings exit status behavior. + The exit status flag was not always being set when the -se flag was set. + + - Some improvements have been made in the method for aligning side comments. + One of the problems that was fixed is that there was a tendency for side comment + placement to drift to the right in long scripts. Programs with side comments + may have a few changes. + + - Some improvements have been made in formatting qw quoted lists. This + fixes issue git #51, in which closing qw pattern delimiters not always following the settings specified by the --closing-token-indentation=n settings. Now qw closing delimiters ')', '}' and ']' follow these flags, and the delimiter '>' follows the flag for ')'. Other qw pattern delimiters remain indented as the are now. This change will cause some small formatting changes in some existing programs. - - Fixed issue git #49, -se breaks warnings exit status behavior. - The exit status flag was not always being set when the -se flag was set. + - Another change involving qw lists is that they get full indentation, + rather than just continuation indentation, if + + (1) the closing delimiter is one of } ) ] > and is on a separate line, + (2) the opening delimiter (i.e. 'qw{' ) is also on a separate line, and + (3) the -xci flag (--extended-continuation-indentation) is set. + + This improves formatting when qw lists are contained in other lists. For example, + + # OLD: perltidy + foreach $color ( + qw( + AntiqueWhite3 Bisque1 Bisque2 Bisque3 Bisque4 + SlateBlue3 RoyalBlue1 SteelBlue2 DeepSkyBlue3 + ), + qw( + LightBlue1 DarkSlateGray1 Aquamarine2 DarkSeaGreen2 + SeaGreen1 Yellow1 IndianRed1 IndianRed2 Tan1 Tan4 + ) + ) + + # NEW, perltidy -xci + foreach $color ( + qw( + AntiqueWhite3 Bisque1 Bisque2 Bisque3 Bisque4 + SlateBlue3 RoyalBlue1 SteelBlue2 DeepSkyBlue3 + ), + qw( + LightBlue1 DarkSlateGray1 Aquamarine2 DarkSeaGreen2 + SeaGreen1 Yellow1 IndianRed1 IndianRed2 Tan1 Tan4 + ) + ) - Some minor improvements have been made to the rules for formatting some edge vertical alignment cases, usually involving two dissimilar lines. - - Some improvements have been made to the location of side comments. - - - Some minor issues that the average user would not encounter were found - and fixed. They can be seen in the more complete list of updates at + - A more complete list of updates is at https://github.com/perltidy/perltidy/blob/master/local-docs/BugLog.pod diff --git a/bin/perltidy b/bin/perltidy index ed90fa18..891ed7f0 100755 --- a/bin/perltidy +++ b/bin/perltidy @@ -746,23 +746,40 @@ number of spaces assigned to a full indentation level on the B<-i=n> command, or =item B<-xci>, B<--extended-continuation-indentation> -This flag causes continuation indentation to "extend" deeper into structures. -If you use B<-ci=n> and B<-i=n> with the same value of B you will probably -want to set this flag. Since this is a fairly new flag, the default is B<-nxci> -to avoid disturbing existing formatting. - -Here is an explanation. There are two common strategies for continuation -indentation. One is the strategy recommend in the original perl style -guidelines, in which B<-ci=2> and B<-i=4>. The other is the strategy is the -strategy recommended for example in the "Perl Best Practices" book by Conway, -in which B<-ci=4> and B<-i=4>. The default formatting in perltidy works fairly -well with the orignal perl style, but problems arise when B<-ci> and B<-i> are -given equal values as in the B style, particularly with ternary -statements. The B<-xci> flag was added to fix this. It may be used with -any value of B<-ci> but is particularly helpful when B<-ci> and B<-i> are given -similar values. - -For an illustration, please see the section L<"B<-pbp>, B<--perl-best-practices>">. +This flag allows perltidy to use some improvements which have been made to its +indentation model. One of the things it does is "extend" continuation +indentation deeper into structures, hence the name. The improved indentation +is particularly noticable when the flags B<-ci=n> and B<-i=n> use the same value of +B. There are no significant disadvantages to using this flag, but to avoid +disturbing existing formatting the default is not to use it, B<-nxci>. + +Please see the section L<"B<-pbp>, B<--perl-best-practices>"> for an example of +how this flag can improve the formatting of ternary statements. It can also +improve indentation of some multi-line qw lists as shown below. + + # perltidy + foreach $color ( + qw( + AntiqueWhite3 Bisque1 Bisque2 Bisque3 Bisque4 + SlateBlue3 RoyalBlue1 SteelBlue2 DeepSkyBlue3 + ), + qw( + LightBlue1 DarkSlateGray1 Aquamarine2 DarkSeaGreen2 + SeaGreen1 Yellow1 IndianRed1 IndianRed2 Tan1 Tan4 + ) + ) + + # perltidy -xci + foreach $color ( + qw( + AntiqueWhite3 Bisque1 Bisque2 Bisque3 Bisque4 + SlateBlue3 RoyalBlue1 SteelBlue2 DeepSkyBlue3 + ), + qw( + LightBlue1 DarkSlateGray1 Aquamarine2 DarkSeaGreen2 + SeaGreen1 Yellow1 IndianRed1 IndianRed2 Tan1 Tan4 + ) + ) =item B<-sil=n> B<--starting-indentation-level=n> @@ -4588,7 +4605,7 @@ The perltidy binary uses the Perl::Tidy module and is installed when that module =head1 VERSION -This man page documents perltidy version 20201207 +This man page documents perltidy version 20210111 =head1 BUG REPORTS diff --git a/dev-bin/perltidy_random_run.pl b/dev-bin/perltidy_random_run.pl index e69c42e2..f8210feb 100755 --- a/dev-bin/perltidy_random_run.pl +++ b/dev-bin/perltidy_random_run.pl @@ -478,9 +478,9 @@ if (@saved_for_deletion) { if (@problems) { print STDERR < 20 ); print STDERR < 20 ); print STDERR < 20 ); print STDERR < +
  • Issues fixed after release 20201207
  • Issues fixed after release 20201202
  • Issues fixed after release 20201001
  • Issues fixed after release 20200907
  • Open Issues
  • +
  • POD ERRORS
  • +

    Issues fixed after release 20201207

    + +
    + +
    Improve indentation of multiline qw quotes when -xci flag is set
    +
    + +

    The indentation of multiline qw quotes runs into problems when there is nesting, as in the following.

    + +
        # OLD: perltidy -xci -ci=4
    +    for my $feep (
    +        qw{
    +        pwage      pwchange   pwclass    pwcomment
    +        pwexpire   pwgecos    pwpasswd   pwquota
    +        }
    +        )
    + +

    The problem is that multiline qw quotes do not get the same indentation treatment as lists.

    + +

    This update fixes this in the following circumstances:

    + +
      - the leading qw( and trailing ) are on separate lines
    +  - the closing token is one of ) } ] >
    +  - the -xci flag is set
    + +

    The above example becomes

    + +
        # NEW: perltidy -xci -ci=4
    +    for my $feep (
    +        qw{
    +            pwage      pwchange   pwclass    pwcomment
    +            pwexpire   pwgecos    pwpasswd   pwquota
    +        }
    +        )
    + +

    The reason that the -xci flag is required is to minimize unexpected changes to existing scripts. The extra indentation is removed if the -wn flag is also given, so both old and new versions with -wn give

    + +
        # OLD and NEW: perltidy -wn -xci -ci=4
    +    for my $feep ( qw{
    +        pwage      pwchange   pwclass    pwcomment
    +        pwexpire   pwgecos    pwpasswd   pwquota
    +    } )
    + +

    This update added 8 Jan 2021, 474cfa8.

    + +
    +
    Improve alignment of leading equals in rare situation
    +
    + +

    A rare case in which a vertical alignment opportunity of leading equals was missed has been fixed. This involved lines with additional varying alignment tokens, such as 'unless' and second '=' in lines 1-3 below. In this example lines 4 and 5 were not 'looking' backwards to align their leading equals.

    + +
        # OLD:
    +    $them = 'localhost' unless ( $them = shift );
    +    $cmd  = '!print'    unless ( $cmd  = shift );
    +    $port = 2345        unless ( $port = shift );
    +    $saddr = 'S n a4 x8';
    +    $SIG{'INT'} = 'dokill';
    +
    +    # NEW
    +    $them       = 'localhost' unless ( $them = shift );
    +    $cmd        = '!print'    unless ( $cmd  = shift );
    +    $port       = 2345        unless ( $port = shift );
    +    $saddr      = 'S n a4 x8';
    +    $SIG{'INT'} = 'dokill';
    + +

    Fixed 5 Jan 2021, 9244678.

    + +
    +
    Moved previous patch to a better location
    +
    + +

    The previous patch was moved to a location where it only applies if there is a side comment on the line with a closing token. This minimizes changes to other side comment locations.

    + +
    +
    Further improvement in rules for forgetting last side comment location
    +
    + +

    The code for forgetting the last side comment location was rewritten to improve formatting in some edge cases. The update also fixes a very rare problem discovered during testing and illustrated with the following snippet. The problem occurs for the particular combination of parameters -sct -act=2 and when a closing paren has a side comment:

    + +
        OLD: perltidy -sct -act=2
    +    foreach $line (
    +        [0, 1, 2], [3, 4, 5], [6, 7, 8],    # rows
    +        [0, 3, 6], [1, 4, 7], [2, 5, 8],    # columns
    +        [0, 4, 8], [2, 4, 6])                                     # diagonals
    +
    +    NEW: perltidy -sct -act=2
    +    foreach $line (
    +        [0, 1, 2], [3, 4, 5], [6, 7, 8],    # rows
    +        [0, 3, 6], [1, 4, 7], [2, 5, 8],    # columns
    +        [0, 4, 8], [2, 4, 6])    # diagonals
    + +

    In the old version the last side comment was aligned before the closing paren was attached to the previous line, causing the final side comment to be far to the right. A patch in the new version just places it at the default location. This is the best than can be done for now, but is preferable to the old formatting. 3 Jan 2021, e57d8db.

    + +
    +
    Improve rule for forgetting last side comment location
    +
    + +

    The code which aligns side comments remembers the most recent side comment and in some cases tries to start aligning at that column for later side comments. Sometimes the old side comment column was being remembered too long, causing occasional poor formatting and causing a noticable and unexpected drift of side comment locations to the right. The rule for forgetting the previous side comment column has been modified to reduce this problem. The new rule is essentially to forget the previous side comment location at a new side comment with different indentation level or significant number of lines without side comments (about 12). The previous implementation forgetting changes in indentation level across code blocks only. Below is an example where the old method gets into trouble and the new method is ok:

    + +
            # OLD:
    +        foreach my $r (@$array) {
    +            $Dat{Data}{ uc $r->[0] } = join( ";", @$r );    # store all info
    +            my $name = $Dat{GivenName}{ uc $r->[0] } || $r->[1];
    +
    +            # pass array as ad-hoc string, mark missing values
    +            $Dat{Data}{ uc $r->[0] } = join(
    +                ";",
    +                (
    +                    uc $r->[0], uc $name,                   # symbol, name
    +                    $r->[2],    $r->[3], $r->[4],           # price, date, time
    +                    $r->[5],    $r->[6],                    # change, %change
    +                    $r->[7],    "-", "-", "-",    # vol, avg vol, bid,ask
    +                    $r->[8],               $r->[9],     # previous, open
    +                    "$r->[10] - $r->[11]", $r->[12],    # day range,year range,
    +                    "-",                   "-", "-", "-", "-"
    +                )
    +            );                                          # eps,p/e,div,yld,cap
    +        }
    + +

    The second side comment is at a deeper indentation level but was not being forgotten, causing line length limits to interfere with later alignment. The new rule gives a better result:

    + +
            # NEW:
    +        foreach my $r (@$array) {
    +            $Dat{Data}{ uc $r->[0] } = join( ";", @$r );    # store all info
    +            my $name = $Dat{GivenName}{ uc $r->[0] } || $r->[1];
    +
    +            # pass array as ad-hoc string, mark missing values
    +            $Dat{Data}{ uc $r->[0] } = join(
    +                ";",
    +                (
    +                    uc $r->[0], uc $name,               # symbol, name
    +                    $r->[2],    $r->[3], $r->[4],       # price, date, time
    +                    $r->[5],    $r->[6],                # change, %change
    +                    $r->[7],    "-", "-", "-",          # vol, avg vol, bid,ask
    +                    $r->[8],               $r->[9],     # previous, open
    +                    "$r->[10] - $r->[11]", $r->[12],    # day range,year range,
    +                    "-",                   "-", "-", "-", "-"
    +                )
    +            );    # eps,p/e,div,yld,cap
    +        }
    + +

    The following exampel shows an unexpected alignment in the cascade of trailing comments which are aligned but slowly separating from their closing containers:

    + +
        # OLD:
    +    {
    +        $a = [
    +            Cascade    => $menu_cb,
    +            -menuitems => [
    +                [ Checkbutton => 'Oil checked', -variable => \$OIL ],
    +                [
    +                    Button   => 'See current values',
    +                    -command => [
    +                        \&see_vars, $TOP,
    +
    +                    ],    # end see_vars
    +                ],        # end button
    +            ],            # end checkbutton menuitems
    +        ];                # end checkbuttons cascade
    +    }
    + +

    This was caused by forgetting side comments only across code block changes. The new result is more reasonable:

    + +
        # NEW:
    +    {
    +        $a = [
    +            Cascade    => $menu_cb,
    +            -menuitems => [
    +                [ Checkbutton => 'Oil checked', -variable => \$OIL ],
    +                [
    +                    Button   => 'See current values',
    +                    -command => [
    +                        \&see_vars, $TOP,
    +
    +                    ],    # end see_vars
    +                ],    # end button
    +            ],    # end checkbutton menuitems
    +        ];    # end checkbuttons cascade
    +    }
    + +

    This change will cause occasional differences in side comment locations from previous versions but overall it gives fewer unexpected results so it is a worthwhile change. 29-Dec-2020, 76993f4.

    + +
    +
    Fixed very minor inconsistency in redefining lists after prune step
    +
    + +

    In rare cases it is necessary to update the type of lists, and this influences vertical alignment. This update fixes a minor inconsistency in doing this. In some rare cases with complex list elements vertical alignment can be improved. 27 Dec, 2020, 751faec.

    + +
                # OLD
    +            return join( '',
    +                $pre,   '<IMG ',   $iconsizes{$alt} || '',
    +                $align, 'BORDER=', $nav_border,
    +                ' ALT="', $alt,        "\"\n",
    +                ' SRC="', $ICONSERVER, "/$icon",
    +                '">' );
    +
    +            # NEW
    +            return join( '',
    +                $pre,     '<IMG ',     $iconsizes{$alt} || '',
    +                $align,   'BORDER=',   $nav_border,
    +                ' ALT="', $alt,        "\"\n",
    +                ' SRC="', $ICONSERVER, "/$icon",
    +                '">' );
    + +
    +
    Improved vertical alignment of some edge cases
    +
    + +

    The existing rules for aligning two lines with very different lengths were rejecting some good alignments, such as the first line of numbers in the example below:

    + +
        # OLD:
    +    @gg_3 = (
    +        [
    +            0.0, 1.360755E-2, 9.569446E-4, 9.569446E-4,
    +            1.043498E-3, 1.043498E-3
    +        ],
    +        [
    +            9.569446E-4, 9.569446E-4, 0.0, 7.065964E-5,
    +            1.422811E-4, 1.422811E-4
    +        ],
    +        ...
    +    );
    +
    +    # NEW:
    +    @gg_3 = (
    +        [
    +            0.0,         1.360755E-2, 9.569446E-4, 9.569446E-4,
    +            1.043498E-3, 1.043498E-3
    +        ],
    +        [
    +            9.569446E-4, 9.569446E-4, 0.0, 7.065964E-5,
    +            1.422811E-4, 1.422811E-4
    +        ],
    +        ...
    +    );
    + +

    The rule in sub 'two_line_pad' was updated to allow alignment of any lists if the patterns match exactly (all numbers in this case). Updated 27-Dec-2020, 035d2b7.

    + +
    +
    Avoid -lp style formatting of lists containing multiline qw quotes
    +
    + +

    The -lp formatting style often does not work well when lists contain multiline qw quotes. This update avoids this problem by not formatting such lists with the -lp style. For example,

    + +
        # OLD, perltidy -gnu
    +    @EXPORT = (
    +        qw(
    +          i Re Im rho theta arg
    +          sqrt log ln
    +          log10 logn cbrt root
    +          cplx cplxe
    +          ),
    +        @trig,
    +              );
    +
    +
    +    # NEW, perltidy -gnu
    +    @EXPORT = (
    +        qw(
    +          i Re Im rho theta arg
    +          sqrt log ln
    +          log10 logn cbrt root
    +          cplx cplxe
    +        ),
    +        @trig,
    +    );
    + +

    27-Dec-2020, 948c9bd.

    + +
    +
    improve formatting of multiline qw
    +
    + +

    This update adds a sequence numbering system for multiline qw quotes. In the perltidy tokenizer normal container pair types, like { }, (), [], are given unique serial numbers which are used as keys to data structures. qw quoted lists do not get serial numbers by the tokenizer, so this update creates a separate serial number scheme for them to correct this problem. One formatting problem that this solves is that of preventing the closing token of a multiline quote from being outdented more than the opening token. This is a general formatting rule which should be followed. Without a sequence number, the closing qw token could not lookup its corresponding opening indentation so it had to resort to a default, breaking the rule, as in the following:

    + +
        # OLD, perltidy -wn
    +    # qw line
    +    if ( $pos == 0 ) {
    +        @return = grep( /^$word/,
    +            sort qw(
    +              ! a b d h i m o q r u autobundle clean
    +              make test install force reload look
    +        ) ); #<-- outdented more than 'sort'
    +    }
    +
    +    # Here is the same with a list instead of a qw; note how the
    +    # closing sort paren does not outdent more than the 'sort' line.
    +    # This is the desired result for qw.
    +    # perltidy -wn
    +    if ( $pos == 0 ) {
    +        @return = grep( /^$word/,
    +            sort (
    +
    +                '!',          'a', 'b', 'd', 'h', 'i', 'm', 'o', 'q', 'r', 'u',
    +                'autobundle', 'clean',
    +                'make',       'test', 'install', 'force', 'reload', 'look'
    +            ) );  #<-- not outdented more than 'sort'
    +    }
    +
    +    # NEW (perltidy -wn)
    +    if ( $pos == 0 ) {
    +        @return = grep( /^$word/,
    +            sort qw(
    +              ! a b d h i m o q r u autobundle clean
    +              make test install force reload look
    +            ) ); #<-- not outdented more than sort
    +    }
    + +

    Here is another example # OLD: $_->meta->make_immutable( inline_constructor => 0, constructor_name => "_new", inline_accessors => 0, ) for qw( Class::XYZ::Package Class::XYZ::Module Class::XYZ::Class

    + +
            Class::XYZ::Overload
    +    );  #<-- outdented more than the line with 'for qw('
    +
    +    # NEW:
    +    $_->meta->make_immutable(
    +        inline_constructor => 0,
    +        constructor_name   => "_new",
    +        inline_accessors   => 0,
    +      )
    +      for qw(
    +      Class::XYZ::Package
    +      Class::XYZ::Module
    +      Class::XYZ::Class
    +
    +      Class::XYZ::Overload
    +      ); #<-- outdented same as the line with 'for qw('
    + +

    26 Dec 2020, cdbf0e4.

    + +
    +
    improve list marking method
    +
    + +

    In the process of making vertical alignments, lines which are simple lists of items are treated different from other lines. The old method for finding and marking these lines had a few problems which are corrected with this update. The main problem was that the old method ran into trouble when there were side comments. For example, the old method was not marking the following list and as a result the two columns of values were not aligned:

    + +
        # OLD
    +    return (
    +        $startpos, $ldelpos - $startpos,         # PREFIX
    +        $ldelpos,  1,                            # OPENING BRACKET
    +        $ldelpos + 1, $endpos - $ldelpos - 2,    # CONTENTS
    +        $endpos - 1, 1,                          # CLOSING BRACKET
    +        $endpos, length($$textref) - $endpos,    # REMAINDER
    +    );
    +
    +    # NEW
    +    return (
    +        $startpos,    $ldelpos - $startpos,           # PREFIX
    +        $ldelpos,     1,                              # OPENING BRACKET
    +        $ldelpos + 1, $endpos - $ldelpos - 2,         # CONTENTS
    +        $endpos - 1,  1,                              # CLOSING BRACKET
    +        $endpos,      length($$textref) - $endpos,    # REMAINDER
    +    );
    + +

    Another problem was that occasionally unwanted alignments were made between lines which were not really lists because the lines were incorrectly marked. For example (note padding after first comma)

    + +
        # OLD: (undesirable alignment)
    +    my ( $isig2, $chisq ) = ( 1 / ( $sig * $sig ), 0 );
    +    my ( $ym,    $al, $cov, $bet, $olda, $ochisq, $di, $pivt, $info ) =
    +      map { null } ( 0 .. 8 );
    +
    +    # NEW: (no alignment)
    +    my ( $isig2, $chisq ) = ( 1 / ( $sig * $sig ), 0 );
    +    my ( $ym, $al, $cov, $bet, $olda, $ochisq, $di, $pivt, $info ) =
    +      map { null } ( 0 .. 8 );
    + +

    This update was made 22 Dec 2020, 36d4c35.

    + +
    +
    Fix git #51, closing quote pattern delimiters not following -cti flag settings
    +
    + +

    Closing pattern delimiter tokens of qw quotes were not following the -cti flag settings for containers in all cases, as would be expected, in particular when followed by a comma. For example, the closing qw paren below was indented with continuation indentation but would not have that extra indentation if it followed the default -cpi setting for a paren:

    + +
        # OLD:
    +    @EXPORT = (
    +        qw(
    +          i Re Im rho theta arg
    +          sqrt log ln
    +          log10 logn cbrt root
    +          cplx cplxe
    +          ),
    +        @trig
    +    );
    +
    +    # NEW
    +    @EXPORT = (
    +        qw(
    +            i Re Im rho theta arg
    +            sqrt log ln
    +            log10 logn cbrt root
    +            cplx cplxe
    +        ),
    +        @trig
    +    );
    + +

    This update makes closing qw quote terminators follow the settings for their corresponding container tokens as closely as possible. For a closing '>' the setting for a closing paren will now be followed. Other closing qw terminators will remain indented, to minimize changes to existing formatting. For example ('>' is outdented):

    + +
        @EXPORT = (
    +        qw<
    +          i Re Im rho theta arg
    +          sqrt log ln
    +          log10 logn cbrt root
    +          cplx cplxe
    +        >,
    +        @trig
    +    );
    + +

    but (';' remains indented):

    + +
        @EXPORT = (
    +        qw;
    +          i Re Im rho theta arg
    +          sqrt log ln
    +          log10 logn cbrt root
    +          cplx cplxe
    +          ;,
    +        @trig
    +    );
    + +

    This update was added 18 Dec 2020 and modified 24 Dec 2020, 538688f.

    + +
    +
    Update manual pages regarding issue git #50
    +
    + +

    Additional wording was added to the man pages regarding situations in which perltidy does not change whitespace. This update was added 17 Dec 2020.

    + +
    +
    Rewrote sub check_match
    +
    + +

    Moved inner part of sub check_match into sub match_line_pair in order to make info available earlier. This gave some minor alignment improvements. This was done 16 Dec 2020, 7ba4f3b.

    + +
        # OLD:
    +    @tests = (
    +        @common,     '$_',
    +        '"\$_"',     '@_',
    +        '"\@_"',     '??N',
    +        '"??N"',     chr 256,
    +        '"\x{100}"', chr 65536,
    +        '"\x{10000}"', ord 'N' == 78 ? ( chr 11, '"\013"' ) : ()
    +    );
    +
    +    # NEW:
    +    @tests = (
    +        @common,       '$_',
    +        '"\$_"',       '@_',
    +        '"\@_"',       '??N',
    +        '"??N"',       chr 256,
    +        '"\x{100}"',   chr 65536,
    +        '"\x{10000}"', ord 'N' == 78 ? ( chr 11, '"\013"' ) : ()
    +    );
    + +
    +
    Improved vertical alignments by avoiding pruning step
    +
    + +

    There is a step in vertical alignment where the alignments are formed into a tree with different levels, and some deeper levels are pruned to preserve lower level alignments. This usually works well, but some deeper alignments will be lost, which is what was happening in the example below. It turns out that if the tree pruning is skipped when alignment depths increase monotonically across lines, as in the example, then better overall alignment is achieved by the subsequent 'sweep' pass.

    + +
        # OLD
    +    my $cmd = shift @ARGV;
    +    if    ( $cmd eq "new" )         { $force_new = 1; }
    +    elsif ( $cmd eq "interactive" ) { $interactive = 1; $batch       = 0; }
    +    elsif ( $cmd eq "batch" )       { $batch       = 1; $interactive = 0; }
    +    elsif ( $cmd eq "use_old" )     { $use_old = 1; }
    +    elsif ( $cmd eq "show" )        { $show    = 1; last; }
    +    elsif ( $cmd eq "showall" )     { $showall = 1; last; }
    +    elsif ( $cmd eq "show_all" )    { $showall = 1; last; }
    +    elsif ( $cmd eq "remove" )      { $remove  = 1; last; }
    +    elsif ( $cmd eq "help" )        { $help    = 1; last; }
    +
    +    # NEW
    +    my $cmd = shift @ARGV;
    +    if    ( $cmd eq "new" )         { $force_new   = 1; }
    +    elsif ( $cmd eq "interactive" ) { $interactive = 1; $batch       = 0; }
    +    elsif ( $cmd eq "batch" )       { $batch       = 1; $interactive = 0; }
    +    elsif ( $cmd eq "use_old" )     { $use_old     = 1; }
    +    elsif ( $cmd eq "show" )        { $show        = 1; last; }
    +    elsif ( $cmd eq "showall" )     { $showall     = 1; last; }
    +    elsif ( $cmd eq "show_all" )    { $showall     = 1; last; }
    +    elsif ( $cmd eq "remove" )      { $remove      = 1; last; }
    +    elsif ( $cmd eq "help" )        { $help        = 1; last; }
    + +

    This update was made 14 Dec 2020, 44e0afa.

    + +
    +
    Improved some marginal vertical alignments
    +
    + +

    This update fixed a rare situation in which some vertical alignment was missed. The problem had to do with two lines being incorrectly marked as a marginal match. A new routine, 'match_line_pairs' was added to set a flag with the information needed to detect and prevent this. This fix was made 13 Dec 2020, 9a8e49b.

    + +
        # OLD
    +    $sec = $sec + ( 60 * $min );
    +    $graphcpu[$sec] = $line;
    +    $secmax  = $sec  if ( $sec > $secmax );
    +    $linemax = $line if ( $line > $linemax );
    +
    +    # NEW
    +    $sec            = $sec + ( 60 * $min );
    +    $graphcpu[$sec] = $line;
    +    $secmax         = $sec  if ( $sec > $secmax );
    +    $linemax        = $line if ( $line > $linemax );
    + +
    +
    Do not align equals across changes in continuation indentation
    +
    + +

    A rule was added to prevent vertical alignment of lines with leading '=' across a change in continuation indentation. Sometimes aligning across a change in CI can come out okay, but sometimes it can be very poor. For example:

    + +
        # BAD:
    +    $!               = 2, die qq/$0: can't stat -${arg}'s "$file"./
    +        unless $time = ( stat($file) )[$STAT_MTIME];
    +
    +    # FIXED:
    +    $! = 2, die qq/$0: can't stat -${arg}'s "$file"./
    +      unless $time = ( stat($file) )[$STAT_MTIME];
    + +

    The second line is a continuation of the first, and this update prevents this alignment. The above 'BAD' formatting was in the previous developmental version of perltidy, not the previous release. This update added 12 Dec 2020, 5b56147.

    + +
    +
    Improve vertical alignment in some two-line matches
    +
    + +

    When two lines would be perfectly aligned except for the line length limit, previously they would only be aligned if they had a common leading equals. The update removes this restriction and allows as many alignments to be made as possible. The results are generally improved. This update was made 11 Dec 2020, f3c6cd8. Some examples:

    + +

    # In this example the side comments were limiting the matches

    + +
        # OLD
    +    shift @data if @data and $data[0] =~ /Contributed\s+Perl/;    # Skip header
    +    pop @data if @data and $data[-1] =~ /^\w/;    # Skip footer, like
    +
    +    # NEW
    +    shift @data if @data and $data[0]  =~ /Contributed\s+Perl/;    # Skip header
    +    pop @data   if @data and $data[-1] =~ /^\w/;    # Skip footer, like
    + +

    # The same is true here.

    + +
        # OLD
    +    if ($tvg::o_span) { $tvg::hour_span = $tvg::o_span; }
    +    if ( $tvg::hour_span % 2 > 0 ) { $tvg::hour_span++; }    # Multiple of 2
    +
    +    # NEW
    +    if ($tvg::o_span)              { $tvg::hour_span = $tvg::o_span; }
    +    if ( $tvg::hour_span % 2 > 0 ) { $tvg::hour_span++; }    # Multiple of 2
    + +

    In the next example, the first comma is now aligned but not the second, because of the line length limit:

    + +
        # OLD
    +    is( MyClass->meta, $mc, '... these metas are still the same thing' );
    +    is( MyClass->meta->meta, $mc->meta, '... these meta-metas are the same thing' );
    +
    +    # NEW
    +    is( MyClass->meta,       $mc, '... these metas are still the same thing' );
    +    is( MyClass->meta->meta, $mc->meta, '... these meta-metas are the same thing' );
    + +

    In this last example, the first comma is not aligned, but alignment resumes after the second comma.

    + +
        # OLD
    +    is( $obj->name, $COMPRESS_FILE, "   Name now set to '$COMPRESS_FILE'" );
    +    is( $obj->prefix, '', "   Prefix now empty" );
    +
    +    # NEW
    +    is( $obj->name, $COMPRESS_FILE, "   Name now set to '$COMPRESS_FILE'" );
    +    is( $obj->prefix, '',           "   Prefix now empty" );
    + +
    +
    Improve vertical alignment in some marginal matches
    +
    + +

    In perltidy a 'marginal match' occurs for example when two lines share some alignment tokens but are somewhat different. When this happens some limits are placed on the size of the padding spaces that can be introduced. In this update the amount of allowed padding is significatly increased for certain 'good' alignment tokens. Results of extensive testing were favorable provided that the change is restricted to alignments of '=', 'if' and 'unless'. Update made 10 Dec 2020, a585f0b.

    + +
        # OLD
    +    my @roles = $self->role_names;
    +    my $role_names = join "|", @roles;
    +
    +    # NEW
    +    my @roles      = $self->role_names;
    +    my $role_names = join "|", @roles;
    +
    +    # OLD
    +    $sysname .= 'del' if $self->label =~ /deletion/;
    +    $sysname .= 'ins' if $self->label =~ /insertion/;
    +    $sysname .= uc $self->allele_ori->seq if $self->allele_ori->seq;
    +
    +    # NEW
    +    $sysname .= 'del'                     if $self->label =~ /deletion/;
    +    $sysname .= 'ins'                     if $self->label =~ /insertion/;
    +    $sysname .= uc $self->allele_ori->seq if $self->allele_ori->seq;
    + +
    +
    Improve vertical alignment of lines ending in fat comma
    +
    + +

    A minor adjustment was made to the rule for aligning lines which end in '=>'. When there are just two lines in an alignment group, the alignment is avoided if the first of the two ends in a '=>'. Previously, alignment was avoided if either ended in a '=>'. The old rule was preventing some good alignments in a later stage of the iteration. In the following example, the last two lines are processed separately because they do not match the comma in 'sprintf'. The new rule allows the fat comma alignment to eventually get made later in the iteration. Update made 9 Dec 2020, ca0ddf4.

    + +
        # OLD
    +    $template->param(
    +        classlist => $classlist,
    +        ...,
    +        suggestion => $suggestion,
    +        totspent   => sprintf( "%.2f", $totspent ),
    +        totcomtd   => sprintf( "%.2f", $totcomtd ),
    +        totavail   => sprintf( "%.2f", $totavail ),
    +        nobudget => $#results == -1 ? 1 : 0,
    +        intranetcolorstylesheet =>
    +          C4::Context->preference("intranetcolorstylesheet"),
    +        ...
    +    );
    +
    +    # NEW
    +    $template->param(
    +        classlist => $classlist,
    +        ...,
    +        suggestion              => $suggestion,
    +        totspent                => sprintf( "%.2f", $totspent ),
    +        totcomtd                => sprintf( "%.2f", $totcomtd ),
    +        totavail                => sprintf( "%.2f", $totavail ),
    +        nobudget                => $#results == -1 ? 1 : 0,
    +        intranetcolorstylesheet =>
    +          C4::Context->preference("intranetcolorstylesheet"),
    +        ...
    +    );
    + +
    +
    Avoid processing a file more than once
    +
    + +

    In the unlikely event that a user enters a filename more than once on the command line to perltidy, as for 'file1.pl' here

    + +
      perltidy file1.pl file1.pl 
    + +

    then that file will be processed more than once. This looks harmless, but if the user was also using the -b (backup) parameter, then the original backup would be overwritten, which is not good. To avoid this, a filter has been placed on the list of files to remove duplicates. 9 Dec 2020, 646a542.

    + +
    +
    + +
    + +
    Fix for issue git #49, exit status not correctly set
    +
    + +

    The exit status flag was not being set for the -w option if the -se or if the -q flag were set. Issue git #44 was similar but a special case of the problem. The problem was fixed 8 Dec 2020, cb6028f.

    + +
    +
    +

    Issues fixed after release 20201202

    @@ -45,7 +692,7 @@ return (); } ); -

    This bug has been fixed, and code which has been incorrectly formatted will be correctly formatted with the next release. The bug was a result of a new coding introduced in v20201202 for fixing some issues with parsing sub signatures. Previously they were sometimes parsed the same as prototypes and sometimes as lists, now they are always parsed as lists.

    +

    This bug has been fixed, and code which has been incorrectly formatted will be correctly formatted with the next release. The bug was a result of a new coding introduced in v20201202 for fixing some issues with parsing sub signatures. Previously they were sometimes parsed the same as prototypes and sometimes as lists, now they are always parsed as lists. Fixed 6 Dec 2020, 6fd0c4f.

    @@ -959,6 +1606,20 @@ +

    POD ERRORS

    + +

    Hey! The above document had some coding errors, which are explained below:

    + +
    + +
    Around line 711:
    +
    + +

    '=item' outside of any '=over'

    + +
    +
    + diff --git a/docs/ChangeLog.html b/docs/ChangeLog.html index 6937e365..529d1638 100644 --- a/docs/ChangeLog.html +++ b/docs/ChangeLog.html @@ -1,8 +1,67 @@

    Perltidy Change Log

    +

    2021 01 11

    + +
    - Fixed issue git #49, -se breaks warnings exit status behavior.
    +The exit status flag was not always being set when the -se flag was set.
    +
    +- Some improvements have been made in the method for aligning side comments.
    +One of the problems that was fixed is that there was a tendency for side comment
    +placement to drift to the right in long scripts.  Programs with side comments
    +may have a few changes.
    +
    +- Some improvements have been made in formatting qw quoted lists.  This
    +fixes issue git #51, in which closing qw pattern delimiters not always
    +following the settings specified by the --closing-token-indentation=n settings.
    +Now qw closing delimiters ')', '}' and ']' follow these flags, and the
    +delimiter '>' follows the flag for ')'.  Other qw pattern delimiters remain
    +indented as the are now.  This change will cause some small formatting changes
    +in some existing programs.
    +
    +- Another change involving qw lists is that they get full indentation,
    +rather than just continuation indentation, if
    +
    +     (1) the closing delimiter is one of } ) ] > and is on a separate line,
    +     (2) the opening delimiter  (i.e. 'qw{' ) is also on a separate line, and
    +     (3) the -xci flag (--extended-continuation-indentation) is set.
    +
    +This improves formatting when qw lists are contained in other lists. For example,
    +
    +        # OLD: perltidy
    +        foreach $color (
    +            qw(
    +            AntiqueWhite3 Bisque1 Bisque2 Bisque3 Bisque4
    +            SlateBlue3 RoyalBlue1 SteelBlue2 DeepSkyBlue3
    +            ),
    +            qw(
    +            LightBlue1 DarkSlateGray1 Aquamarine2 DarkSeaGreen2
    +            SeaGreen1 Yellow1 IndianRed1 IndianRed2 Tan1 Tan4
    +            )
    +          )
    +
    +        # NEW, perltidy -xci
    +        foreach $color (
    +            qw(
    +                AntiqueWhite3 Bisque1 Bisque2 Bisque3 Bisque4
    +                SlateBlue3 RoyalBlue1 SteelBlue2 DeepSkyBlue3
    +            ),
    +            qw(
    +                LightBlue1 DarkSlateGray1 Aquamarine2 DarkSeaGreen2
    +                SeaGreen1 Yellow1 IndianRed1 IndianRed2 Tan1 Tan4
    +            )
    +          )
    +
    +- Some minor improvements have been made to the rules for formatting
    +some edge vertical alignment cases, usually involving two dissimilar lines.
    +
    +- A more complete list of updates is at
    +
    +       https://github.com/perltidy/perltidy/blob/master/local-docs/BugLog.pod
    +
    +

    2020 12 07

    -
    - Fixed issue git #47, incorrect welding of anonymous subs. 
    +
    - Fixed issue git #47, incorrect welding of anonymous subs.
       An incorrect weld format was being made when the --weld-nested-containers option
       (-wn) was used in to format a function which returns a list of anonymous subs.
       For example, the following snippet was incorrectly being welded.
    diff --git a/docs/Tidy.html b/docs/Tidy.html
    index be01abdd..070716e9 100644
    --- a/docs/Tidy.html
    +++ b/docs/Tidy.html
    @@ -372,7 +372,7 @@
     
     

    VERSION

    -

    This man page documents Perl::Tidy version 20201207

    +

    This man page documents Perl::Tidy version 20210111

    LICENSE

    diff --git a/docs/perltidy.html b/docs/perltidy.html index 3914d9cc..46c9b0f7 100644 --- a/docs/perltidy.html +++ b/docs/perltidy.html @@ -356,7 +356,11 @@
    -l=n, --maximum-line-length=n
    -

    The default maximum line length is n=80 characters. Perltidy will try to find line break points to keep lines below this length. However, long quotes and side comments may cause lines to exceed this length. Setting -l=0 is equivalent to setting -l=(a large number).

    +

    The default maximum line length is n=80 characters. Perltidy will try to find line break points to keep lines below this length. However, long quotes and side comments may cause lines to exceed this length.

    + +

    The default length of 80 comes from the past when this was the standard CRT screen width. Many programmers prefer to increase this to something like 120.

    + +

    Setting -l=0 is equivalent to setting -l=(a very large number). But this is not recommended because, for example, a very long list will be formatted in a single long line.

    -vmll, --variable-maximum-line-length
    @@ -568,11 +572,33 @@
    -xci, --extended-continuation-indentation
    -

    This flag causes continuation indentation to "extend" deeper into structures. If you use -ci=n and -i=n with the same value of n you will probably want to set this flag. Since this is a fairly new flag, the default is -nxci to avoid disturbing existing formatting.

    +

    This flag allows perltidy to use some improvements which have been made to its indentation model. One of the things it does is "extend" continuation indentation deeper into structures, hence the name. The improved indentation is particularly noticable when the flags -ci=n and -i=n use the same value of n. There are no significant disadvantages to using this flag, but to avoid disturbing existing formatting the default is not to use it, -nxci.

    + +

    Please see the section "-pbp, --perl-best-practices" for an example of how this flag can improve the formatting of ternary statements. It can also improve indentation of some multi-line qw lists as shown below.

    -

    Here is an explanation. There are two common strategies for continuation indentation. One is the strategy recommend in the original perl style guidelines, in which -ci=2 and -i=4. The other is the strategy is the strategy recommended for example in the "Perl Best Practices" book by Conway, in which -ci=4 and -i=4. The default formatting in perltidy works fairly well with the orignal perl style, but problems arise when -ci and -i are given equal values as in the pbp style, particularly with ternary statements. The -xci flag was added to fix this. It may be used with any value of -ci but is particularly helpful when -ci and -i are given similar values.

    +
                # perltidy
    +            foreach $color (
    +                qw(
    +                AntiqueWhite3 Bisque1 Bisque2 Bisque3 Bisque4
    +                SlateBlue3 RoyalBlue1 SteelBlue2 DeepSkyBlue3
    +                ),
    +                qw(
    +                LightBlue1 DarkSlateGray1 Aquamarine2 DarkSeaGreen2
    +                SeaGreen1 Yellow1 IndianRed1 IndianRed2 Tan1 Tan4
    +                )
    +              )
     
    -

    For an illustration, please see the section "-pbp, --perl-best-practices".

    + # perltidy -xci + foreach $color ( + qw( + AntiqueWhite3 Bisque1 Bisque2 Bisque3 Bisque4 + SlateBlue3 RoyalBlue1 SteelBlue2 DeepSkyBlue3 + ), + qw( + LightBlue1 DarkSlateGray1 Aquamarine2 DarkSeaGreen2 + SeaGreen1 Yellow1 IndianRed1 IndianRed2 Tan1 Tan4 + ) + )
    -sil=n --starting-indentation-level=n
    @@ -913,6 +939,18 @@

    Related issues arise with other binary operator symbols, such as + and -, and in older versions of perl there could be problems with ternary operators. So to avoid changing program behavior, perltidy has the simple rule that whitespace around possible filehandles is left unchanged. Likewise, whitespace around barewords is left unchanged. The reason is that if the barewords are defined in other modules, or in code that has not even been written yet, perltidy will not have seen their prototypes and must treat them cautiously.

    +

    In perltidy this is implemented in the tokenizer by marking token following a print keyword as a special type Z. When formatting is being done, whitespace following this token type is generally left unchanged as a precaution against changing program behavior. This is excessively conservative but simple and easy to implement. Keywords which are treated similarly to print include printf, sort, exec, system. Changes in spacing around parameters following these keywords may have to be made manually. For example, the space, or lack of space, after the parameter $foo in the following line will be unchanged in formatting.

    + +
       system($foo );
    +   system($foo);
    + +

    To find if a token is of type Z you can use perltidy -DEBUG. For the first line above the result is

    + +
       1: system($foo );
    +   1: kkkkkk{ZZZZb};
    + +

    which shows that system is type k (keyword) and $foo is type Z.

    +
    Note2: Perltidy's whitespace rules are not perfect
    @@ -3522,7 +3560,7 @@

    VERSION

    -

    This man page documents perltidy version 20201207

    +

    This man page documents perltidy version 20210111

    BUG REPORTS

    diff --git a/lib/Perl/Tidy.pm b/lib/Perl/Tidy.pm index d2184f17..828f20c4 100644 --- a/lib/Perl/Tidy.pm +++ b/lib/Perl/Tidy.pm @@ -110,7 +110,7 @@ BEGIN { # Release version must be bumped, and it is probably past time for a # release anyway. - $VERSION = '20201207'; + $VERSION = '20210111'; } sub DESTROY { @@ -2801,7 +2801,7 @@ sub generate_options { blank-lines-before-subs=0 blank-lines-before-packages=0 notabs - ) + ) ], # 'extrude' originally deleted pod and comments, but to keep it @@ -2833,7 +2833,7 @@ sub generate_options { nofuzzy-line-length notabs norecombine - ) + ) ], # this style tries to follow the GNU Coding Standards (which do @@ -2842,7 +2842,7 @@ sub generate_options { 'gnu-style' => [ qw( lp bl noll pt=2 bt=2 sbt=2 cpi=1 csbi=1 cbi=1 - ) + ) ], # Style suggested in Damian Conway's Perl Best Practices @@ -3612,7 +3612,7 @@ sub Win_OS_Type { 90 => "Me" }, 2 => { - 0 => "2000", # or NT 4, see below + 0 => "2000", # or NT 4, see below 1 => "XP/.Net", 2 => "Win2003", 51 => "NT3.51" diff --git a/lib/Perl/Tidy.pod b/lib/Perl/Tidy.pod index 2895c5e4..e4c218a4 100644 --- a/lib/Perl/Tidy.pod +++ b/lib/Perl/Tidy.pod @@ -432,7 +432,7 @@ The module 'Perl::Tidy' comes with a binary 'perltidy' which is installed when t =head1 VERSION -This man page documents Perl::Tidy version 20201207 +This man page documents Perl::Tidy version 20210111 =head1 LICENSE diff --git a/lib/Perl/Tidy/Debugger.pm b/lib/Perl/Tidy/Debugger.pm index 28a3b33a..2a5fb266 100644 --- a/lib/Perl/Tidy/Debugger.pm +++ b/lib/Perl/Tidy/Debugger.pm @@ -7,7 +7,7 @@ package Perl::Tidy::Debugger; use strict; use warnings; -our $VERSION = '20201207'; +our $VERSION = '20210111'; sub new { diff --git a/lib/Perl/Tidy/DevNull.pm b/lib/Perl/Tidy/DevNull.pm index 60449b58..aee1966d 100644 --- a/lib/Perl/Tidy/DevNull.pm +++ b/lib/Perl/Tidy/DevNull.pm @@ -7,7 +7,7 @@ package Perl::Tidy::DevNull; use strict; use warnings; -our $VERSION = '20201207'; +our $VERSION = '20210111'; sub new { my $self = shift; return bless {}, $self } sub print { return } sub close { return } diff --git a/lib/Perl/Tidy/Diagnostics.pm b/lib/Perl/Tidy/Diagnostics.pm index ceadacbc..3bad18fe 100644 --- a/lib/Perl/Tidy/Diagnostics.pm +++ b/lib/Perl/Tidy/Diagnostics.pm @@ -20,7 +20,7 @@ package Perl::Tidy::Diagnostics; use strict; use warnings; -our $VERSION = '20201207'; +our $VERSION = '20210111'; sub AUTOLOAD { diff --git a/lib/Perl/Tidy/FileWriter.pm b/lib/Perl/Tidy/FileWriter.pm index 47ddc8aa..d10bcae9 100644 --- a/lib/Perl/Tidy/FileWriter.pm +++ b/lib/Perl/Tidy/FileWriter.pm @@ -7,7 +7,7 @@ package Perl::Tidy::FileWriter; use strict; use warnings; -our $VERSION = '20201207'; +our $VERSION = '20210111'; use constant DEVEL_MODE => 0; diff --git a/lib/Perl/Tidy/Formatter.pm b/lib/Perl/Tidy/Formatter.pm index 2e9bf525..6bc33412 100644 --- a/lib/Perl/Tidy/Formatter.pm +++ b/lib/Perl/Tidy/Formatter.pm @@ -49,7 +49,7 @@ use constant DEVEL_MODE => 0; { #<<< A non-indenting brace to contain all lexical variables use Carp; -our $VERSION = '20201207'; +our $VERSION = '20210111'; # The Tokenizer will be loaded with the Formatter ##use Perl::Tidy::Tokenizer; # for is_keyword() @@ -19142,7 +19142,7 @@ sub make_paren_name { # qw< # far # farfar - # farfars far + # farfars-far # >, # ); if ( !defined($cti) && length($tok) == 1 ) { diff --git a/lib/Perl/Tidy/HtmlWriter.pm b/lib/Perl/Tidy/HtmlWriter.pm index 9c85cc15..4432f300 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 = '20201207'; +our $VERSION = '20210111'; use File::Basename; diff --git a/lib/Perl/Tidy/IOScalar.pm b/lib/Perl/Tidy/IOScalar.pm index 68972bb1..c38b68f7 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 = '20201207'; +our $VERSION = '20210111'; sub AUTOLOAD { diff --git a/lib/Perl/Tidy/IOScalarArray.pm b/lib/Perl/Tidy/IOScalarArray.pm index bd71fbe6..5e496145 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 = '20201207'; +our $VERSION = '20210111'; sub AUTOLOAD { diff --git a/lib/Perl/Tidy/IndentationItem.pm b/lib/Perl/Tidy/IndentationItem.pm index 5453c583..b9ba6843 100644 --- a/lib/Perl/Tidy/IndentationItem.pm +++ b/lib/Perl/Tidy/IndentationItem.pm @@ -8,7 +8,7 @@ package Perl::Tidy::IndentationItem; use strict; use warnings; -our $VERSION = '20201207'; +our $VERSION = '20210111'; BEGIN { diff --git a/lib/Perl/Tidy/LineBuffer.pm b/lib/Perl/Tidy/LineBuffer.pm index f4f15f0c..194b3562 100644 --- a/lib/Perl/Tidy/LineBuffer.pm +++ b/lib/Perl/Tidy/LineBuffer.pm @@ -12,7 +12,7 @@ package Perl::Tidy::LineBuffer; use strict; use warnings; -our $VERSION = '20201207'; +our $VERSION = '20210111'; sub AUTOLOAD { diff --git a/lib/Perl/Tidy/LineSink.pm b/lib/Perl/Tidy/LineSink.pm index d25080a3..dd841402 100644 --- a/lib/Perl/Tidy/LineSink.pm +++ b/lib/Perl/Tidy/LineSink.pm @@ -8,7 +8,7 @@ package Perl::Tidy::LineSink; use strict; use warnings; -our $VERSION = '20201207'; +our $VERSION = '20210111'; sub AUTOLOAD { diff --git a/lib/Perl/Tidy/LineSource.pm b/lib/Perl/Tidy/LineSource.pm index 7c04c608..aed237c9 100644 --- a/lib/Perl/Tidy/LineSource.pm +++ b/lib/Perl/Tidy/LineSource.pm @@ -8,7 +8,7 @@ package Perl::Tidy::LineSource; use strict; use warnings; -our $VERSION = '20201207'; +our $VERSION = '20210111'; sub AUTOLOAD { diff --git a/lib/Perl/Tidy/Logger.pm b/lib/Perl/Tidy/Logger.pm index 9d2cce88..60ea51ab 100644 --- a/lib/Perl/Tidy/Logger.pm +++ b/lib/Perl/Tidy/Logger.pm @@ -7,7 +7,7 @@ package Perl::Tidy::Logger; use strict; use warnings; -our $VERSION = '20201207'; +our $VERSION = '20210111'; sub AUTOLOAD { diff --git a/lib/Perl/Tidy/Tokenizer.pm b/lib/Perl/Tidy/Tokenizer.pm index 932c8816..30b2c30f 100644 --- a/lib/Perl/Tidy/Tokenizer.pm +++ b/lib/Perl/Tidy/Tokenizer.pm @@ -21,7 +21,7 @@ package Perl::Tidy::Tokenizer; use strict; use warnings; -our $VERSION = '20201207'; +our $VERSION = '20210111'; use Perl::Tidy::LineBuffer; use Carp; @@ -3990,7 +3990,7 @@ EOM ) { $statement_type = $tok; # next '{' is block - $type = 'k'; # for keyword syntax coloring + $type = 'k'; # for keyword syntax coloring } # patch for SWITCH/CASE if switch and given not keywords diff --git a/lib/Perl/Tidy/VerticalAligner.pm b/lib/Perl/Tidy/VerticalAligner.pm index 26a090a2..81d999f4 100644 --- a/lib/Perl/Tidy/VerticalAligner.pm +++ b/lib/Perl/Tidy/VerticalAligner.pm @@ -1,7 +1,7 @@ package Perl::Tidy::VerticalAligner; use strict; use warnings; -our $VERSION = '20201207'; +our $VERSION = '20210111'; use Perl::Tidy::VerticalAligner::Alignment; use Perl::Tidy::VerticalAligner::Line; @@ -2436,7 +2436,7 @@ EOM return ( $max_lev_diff, $saw_side_comment ); } - my $has_terminal_match = $rlines->[-1]->get_j_terminal_match(); + my $has_terminal_match = $rlines->[-1]->get_j_terminal_match(); # ignore hanging side comments in these operations my @filtered = grep { !$_->get_is_hanging_side_comment() } @{$rlines}; @@ -3936,7 +3936,7 @@ sub Dump_tree_groups { $j0_eq_pad = $pad; $j0_max_pad = 0.5 * ( $rfield_lengths_1->[0] + $rfield_lengths_0->[0] ); - $j0_max_pad = 4 if ($j0_max_pad < 4); + $j0_max_pad = 4 if ( $j0_max_pad < 4 ); } } @@ -4140,7 +4140,7 @@ sub Dump_tree_groups { || TEST_MARGINAL_EQ_ALIGNMENT ) && $j0_eq_pad >= -$j0_max_pad - && $j0_eq_pad <= $j0_max_pad + && $j0_eq_pad <= $j0_max_pad ) { @@ -4332,8 +4332,8 @@ sub align_side_comments { # Given: # $rlines - the lines # $rgroups - the partition of the lines into groups - # - # We will be working group-by-group because all side comments + # + # We will be working group-by-group because all side comments # (real or fake) in each group are already aligned. So we just have # to make alignments between groups wherever possible. @@ -4375,7 +4375,7 @@ sub align_side_comments { return unless @todo; # Count $num5 = number of comments in the 5 lines after the first comment - # This is an important factor in a decision formula + # This is an important factor in a decision formula my $num5 = 1; for ( my $jj = $j_sc_beg + 1 ; $jj < @{$rlines} ; $jj++ ) { my $ldiff = $jj - $j_sc_beg; diff --git a/lib/Perl/Tidy/VerticalAligner/Alignment.pm b/lib/Perl/Tidy/VerticalAligner/Alignment.pm index e5a33df1..53a5896f 100644 --- a/lib/Perl/Tidy/VerticalAligner/Alignment.pm +++ b/lib/Perl/Tidy/VerticalAligner/Alignment.pm @@ -10,7 +10,7 @@ use warnings; { #<<< A non-indenting brace -our $VERSION = '20201207'; +our $VERSION = '20210111'; # _column_ # the current column number # _saved_column_ # a place for temporary storage diff --git a/lib/Perl/Tidy/VerticalAligner/Line.pm b/lib/Perl/Tidy/VerticalAligner/Line.pm index 2d5c0b5f..9aa4b007 100644 --- a/lib/Perl/Tidy/VerticalAligner/Line.pm +++ b/lib/Perl/Tidy/VerticalAligner/Line.pm @@ -8,7 +8,7 @@ package Perl::Tidy::VerticalAligner::Line; use strict; use warnings; -our $VERSION = '20201207'; +our $VERSION = '20210111'; BEGIN { my $i = 0; diff --git a/local-docs/BugLog.pod b/local-docs/BugLog.pod index 7ed103a8..b219fa22 100644 --- a/local-docs/BugLog.pod +++ b/local-docs/BugLog.pod @@ -44,7 +44,7 @@ given, so both old and new versions with -wn give pwexpire pwgecos pwpasswd pwquota } ) -This update added 8 Jan 2021. +This update added 8 Jan 2021, 474cfa8. =item B @@ -59,7 +59,7 @@ lines 4 and 5 were not 'looking' backwards to align their leading equals. $port = 2345 unless ( $port = shift ); $saddr = 'S n a4 x8'; $SIG{'INT'} = 'dokill'; - + # NEW $them = 'localhost' unless ( $them = shift ); $cmd = '!print' unless ( $cmd = shift ); @@ -67,7 +67,7 @@ lines 4 and 5 were not 'looking' backwards to align their leading equals. $saddr = 'S n a4 x8'; $SIG{'INT'} = 'dokill'; -Fixed 5 Jan 2021. +Fixed 5 Jan 2021, 9244678. =item B @@ -277,7 +277,7 @@ quotes. This update avoids this problem by not formatting such lists with the cplx cplxe ), @trig, - ); + ); # NEW, perltidy -gnu @@ -666,7 +666,7 @@ two lines are processed separately because they do not match the comma in 'sprintf'. The new rule allows the fat comma alignment to eventually get made later in the iteration. Update made 9 Dec 2020, ca0ddf4. - # OLD + # OLD $template->param( classlist => $classlist, ..., -- 2.39.5