From e55931deff6c3c8c531b6a0005ae4eb7534dc768 Mon Sep 17 00:00:00 2001 From: Steve Hancock Date: Mon, 30 Dec 2024 02:34:47 -0800 Subject: [PATCH] bump version to 20240903.09 --- CHANGES.md | 9 +- MANIFEST | 1 + bin/perltidy | 30 +- docs/ChangeLog.html | 70 ++- docs/Tidy.html | 30 +- docs/perltidy.html | 644 +++++++++++---------- examples/dump_unique_keys.pl | 2 +- lib/Perl/Tidy.pm | 2 +- lib/Perl/Tidy.pod | 2 +- lib/Perl/Tidy/Debugger.pm | 2 +- lib/Perl/Tidy/Diagnostics.pm | 2 +- lib/Perl/Tidy/FileWriter.pm | 2 +- lib/Perl/Tidy/Formatter.pm | 8 +- 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/Logger.pm | 2 +- lib/Perl/Tidy/Tokenizer.pm | 2 +- lib/Perl/Tidy/VerticalAligner.pm | 2 +- lib/Perl/Tidy/VerticalAligner/Alignment.pm | 2 +- lib/Perl/Tidy/VerticalAligner/Line.pm | 2 +- 22 files changed, 468 insertions(+), 354 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 7190f8d9..88004a89 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,6 +1,10 @@ # Perltidy Change Log -## 2024 09 03.08 +## 2024 09 03.09 + + - Added missing 'use File::Temp' for -html option. This was causing the + message: "Undefined subroutine &File::Temp::tempfile called at ..." + See git #176. - A new parameter --dump-unique-keys, or B<-duk>, dumps a list of hash keys which appear to be used just once, and do not appear among the quoted @@ -111,9 +115,6 @@ $st_blocks ); - - Added missing 'use File::Temp' for -html option. This was causing the - message: "Undefined subroutine &File::Temp::tempfile called at ..." - ## 2024 09 03 - Add partial support for Syntax::Operator::In and Syntax::Keyword::Match diff --git a/MANIFEST b/MANIFEST index 479e3ab2..46e37149 100644 --- a/MANIFEST +++ b/MANIFEST @@ -17,6 +17,7 @@ docs/tutorial.html examples/bbtidy.pl examples/break_long_quotes.pl examples/delete_ending_blank_lines.pl +examples/dump_unique_keys.pl examples/ex_mp.pl examples/filter_example.in examples/filter_example.pl diff --git a/bin/perltidy b/bin/perltidy index d51e20b8..27be6d38 100644 --- a/bin/perltidy +++ b/bin/perltidy @@ -7230,20 +7230,20 @@ The following list shows all short parameter names which allow a prefix ce conv cpb cs csc cscb cscw dac dbc dbs dcbl dcsc ddf dia dior dln dltc dma dmcp dmr dnl dop dp dpro drc dsc dsm dsn dtc dtco - 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 ils iob ipc isbc iscl - kgb kgbd kgbi kis lal log lop lp lsl mci - mem nib ohbr okw ola olc oll olq opr opt - osbc osbr otr ple pod pvl q qwaf 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 vwe w wfc wia wma - wme wmr wn x xbt xci xlp xs + dtt duk 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 ils iob ipc isbc + iscl kgb kgbd kgbi kis lal log lop lp lsl + mci mem nib ohbr okw ola olc oll olq opr + opt osbc osbr otr ple pod pvl q qwaf 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 vwe w wfc wia + wma wme wmr wn x xbt xci xlp xs Equivalently, the prefix 'no' or 'no-' on the corresponding long names may be used. @@ -7342,7 +7342,7 @@ The perltidy binary uses the Perl::Tidy module and is installed when that module =head1 VERSION -This man page documents perltidy version 20240903.08 +This man page documents perltidy version 20240903.09 =head1 BUG REPORTS diff --git a/docs/ChangeLog.html b/docs/ChangeLog.html index 016b15c4..faa10136 100644 --- a/docs/ChangeLog.html +++ b/docs/ChangeLog.html @@ -1,8 +1,64 @@

Perltidy Change Log

-

2024 09 03.07

+

2024 09 03.09

-
- Added parameter --indent-leading-semicolon, -ils; see git #171. When
+
- Added missing 'use File::Temp' for -html option. This was causing the
+  message: "Undefined subroutine &File::Temp::tempfile called at ..."
+  See git #176.
+
+- A new parameter --dump-unique-keys, or B<-duk>, dumps a list of hash keys
+  which appear to be used just once, and do not appear among the quoted
+  strings in a file. For example:
+
+     perltidy -duk File.pm >output.txt
+
+  The purpose is to help locate misspelled hash keys.
+
+- Line breaks at long chains of method calls now break at all calls
+  with args in parens, as in this example from git #171
+
+    # Old default
+    sub bla_p( $value = 42 ) {
+        return Mojo::Promise->resolve($value)->then( sub { shift() / 2 } )
+          ->then( sub { shift() + 6 } )->then( sub { shift() / 2 } )
+          ->catch( sub { warn shift } );
+    }
+
+    # New default
+    sub bla_p( $value = 42 ) {
+        return Mojo::Promise->resolve($value)
+          ->then( sub { shift() / 2 } )
+          ->then( sub { shift() + 6 } )
+          ->then( sub { shift() / 2 } )
+          ->catch( sub { warn shift } );
+    }
+
+- An update for parameter --break-at-old-method-breakpoints, or -bom,
+has been made to insure that it only applies to lines beginning with
+method calls, as intended.  Line breaks for all lines beginning with
+'->', even non-method calls, can be retained by using
+--keep-old-breakpoints_before='->'.
+
+- Added parameter --multiple-token-tightness=s, or -mutt=s.
+The default value --paren-tightness=1 adds space within the parens
+if, and only if, the container holds multiple tokens.  Some perltidy
+tokens may be rather long, and it can be preferable to also space some of
+them as if they were multple tokens.  This can be done with this paramter,
+and it applies to parens as well as square brackets and curly braces.
+For example, the default below has no space within the square brackets:
+
+    # perltidy
+    my $rlist = [qw( alpha beta gamma )];
+
+Spaces can be obtained with:
+
+    # perltidy -mutt='q*'
+    my $rlist = [ qw( alpha beta gamma ) ];
+
+The parameter -mutt='q*' means treat qw and similar quote operators as
+multiple tokens.  The manual has details; git #120 has another example.
+
+- Added parameter --indent-leading-semicolon, -ils; see git #171. When
 this is negated, a line with a leading semicolon does not get the extra
 leading continuation indentation spaces (defined with -ci=n).
 
@@ -15,6 +71,14 @@ example, a space is now added before the closing paren here:
    NEW:
    push( @script, <<'EOT' );
 
+Also, any spaces between the '<<' and here target are removed (git #174):
+
+   OLD:
+   push( @script, <<  'EOT');
+
+   NEW:
+   push( @script, <<'EOT' );
+
 - Added parameter --break-at-trailing-comma-types=s, or -btct=s, where
 s is a string which selects trailing commas.  For example, -btct='f(b'
 places a line break after all bare trailing commas in function calls.
@@ -1691,7 +1755,7 @@ signatures.  Reformatting with the current version will fix the problem.
 
 

2019 06 01

-
- rt #128477: Prevent inconsistent owner/group and setuid/setgid bits. 
+
- rt #128477: Prevent inconsistent owner/group and setuid/setgid bits.
   In the -b (--backup-and-modify-in-place) mode, an attempt is made to set ownership
   of the output file equal to the input file, if they differ.
   In all cases, if the final output file ownership differs from input file, any setuid/setgid bits are cleared.
diff --git a/docs/Tidy.html b/docs/Tidy.html
index d8db4005..a725af1d 100644
--- a/docs/Tidy.html
+++ b/docs/Tidy.html
@@ -45,7 +45,7 @@
         errorfile         => $errorfile,
         teefile           => $teefile,
         debugfile         => $debugfile,
-        formatter         => $formatter,           # callback object (see below)
+        formatter         => $formatter,    # callback object (see below)
         dump_options      => $dump_options,
         dump_options_type => $dump_options_type,
         prefilter         => $prefilter_coderef,
@@ -65,17 +65,17 @@
 
 

The module accepts input and output streams by a variety of methods. The following list of parameters may be any of the following: a filename, an ARRAY reference, a SCALAR reference, or an object with either a getline or print method, as appropriate.

-
        source            - the source of the script to be formatted
-        destination       - the destination of the formatted output
-        stderr            - standard error output
-        perltidyrc        - the .perltidyrc file
-        logfile           - the .LOG file stream, if any
-        errorfile         - the .ERR file stream, if any
-        dump_options      - ref to a hash to receive parameters (see below),
-        dump_options_type - controls contents of dump_options
-        dump_getopt_flags - ref to a hash to receive Getopt flags
-        dump_options_category - ref to a hash giving category of options
-        dump_abbreviations    - ref to a hash giving all abbreviations
+
    source            - the source of the script to be formatted
+    destination       - the destination of the formatted output
+    stderr            - standard error output
+    perltidyrc        - the .perltidyrc file
+    logfile           - the .LOG file stream, if any
+    errorfile         - the .ERR file stream, if any
+    dump_options      - ref to a hash to receive parameters (see below),
+    dump_options_type - controls contents of dump_options
+    dump_getopt_flags - ref to a hash to receive Getopt flags
+    dump_options_category - ref to a hash giving category of options
+    dump_abbreviations    - ref to a hash giving all abbreviations

The following chart illustrates the logic used to decide how to treat a parameter.

@@ -271,8 +271,8 @@ source => \$source_string, destination => \$dest_string, stderr => \$stderr_string, - errorfile => \$errorfile_string, # ignored when -se flag is set - ##phasers => 'stun', # uncomment to trigger an error + errorfile => \$errorfile_string, # ignored when -se flag is set + ##phasers => 'stun', # uncomment to trigger an error ); if ($error) { @@ -399,7 +399,7 @@

VERSION

-

This man page documents Perl::Tidy version 20240903.07

+

This man page documents Perl::Tidy version 20240903.09

LICENSE

diff --git a/docs/perltidy.html b/docs/perltidy.html index 1c82f90a..7992fd46 100644 --- a/docs/perltidy.html +++ b/docs/perltidy.html @@ -146,7 +146,7 @@
  perltidy -html somefile.pl
-

This will produce a file somefile.pl.html containing the script with html markup. The output file will contain an embedded style sheet in the <HEAD> section which may be edited to change the appearance.

+

This will produce a file somefile.pl.html containing the script with html markup. The output file will contain an embedded style sheet in the <HEAD> section which may be edited to change the appearance.

  perltidy -html -css=mystyle.css somefile.pl
@@ -154,7 +154,7 @@
  perltidy -html -pre somefile.pl
-

Write an html snippet with only the PRE section to somefile.pl.html. This is useful when code snippets are being formatted for inclusion in a larger web page. No style sheet will be written in this case.

+

Write an html snippet with only the <PRE> section to somefile.pl.html. This is useful when code snippets are being formatted for inclusion in a larger web page. No style sheet will be written in this case.

  perltidy -html -ss >mystyle.css
@@ -265,11 +265,11 @@

Here are some examples:

-
  Parameter           Extension          Backup File Treatment
-  <-bext=bak>         F<.bak>            Keep (same as the default behavior)
-  <-bext='/'>         F<.bak>            Delete if no errors
-  <-bext='/backup'>   F<.backup>         Delete if no errors
-  <-bext='original/'> F<.original>       Delete if no errors
+
  Parameter          Extension      Backup File Treatment
+  -bext=bak         .bak            Keep (same as default behavior)
+  -bext='/'         .bak            Delete if no errors
+  -bext='/backup'   .backup         Delete if no errors
+  -bext='original/' .original       Delete if no errors
-bm=s, --backup-method=s
@@ -571,7 +571,7 @@
-it=n, --iterations=n
-

This flag causes perltidy to do n complete iterations. The reason for this flag is that code beautification is an iterative process and in some cases the output from perltidy can be different if it is applied a second time. For most purposes the default of n=1 should be satisfactory. However n=2 can be useful when a major style change is being made, or when code is being beautified on check-in to a source code control system. It has been found to be extremely rare for the output to change after 2 iterations. If a value n is greater than 2 is input then a convergence test will be used to stop the iterations as soon as possible, almost always after 2 iterations. See the next item for a simplified iteration control.

+

This flag causes perltidy to do n complete iterations. The reason for this flag is that code formatting is an iterative process and in some cases the output from perltidy can be different if it is applied a second time. For most purposes the default of n=1 should be satisfactory. However n=2 can be useful when a major style change is being made, or when code is being beautified on check-in to a source code control system. It has been found to be extremely rare for the output to change after 2 iterations. If a value n is greater than 2 is input then a convergence test will be used to stop the iterations as soon as possible, almost always after 2 iterations. See the next item for a simplified iteration control.

This flag has no effect when perltidy is used to generate html.

@@ -579,7 +579,7 @@
-conv, --converge
-

This flag is equivalent to -it=4 and is included to simplify iteration control. For all practical purposes one either does or does not want to be sure that the output is converged, and there is no penalty to using a large iteration limit since perltidy will check for convergence and stop iterating as soon as possible. The default is -nconv (no convergence check). Using -conv will approximately double run time since typically one extra iteration is required to verify convergence. No extra iterations are required if no new line breaks are made, and two extra iterations are occasionally needed when reformatting complex code structures, such as deeply nested ternary statements.

+

This flag is equivalent to -it=4 and is included to simplify iteration control. Perltidy will check for convergence and stop iterating as soon as possible. The default is -nconv (no convergence check). Using -conv will approximately double run time since typically one extra iteration is required to verify convergence. No extra iterations are required if no new line breaks are made, and two extra iterations are occasionally needed when reformatting complex code structures, such as deeply nested ternary statements.

@@ -617,29 +617,29 @@

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 multiline qw lists as shown below.

-
            # perltidy
-            foreach $color (
-                qw(
+
        # 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(
+            ),
+            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
-                )
-              )
+ ) + )
-mci, --minimize-continuation-indentation
@@ -647,17 +647,17 @@

This flag allows perltidy to remove continuation indentation in some special cases where it is not really unnecessary. For a simple example, the default formatting for the following snippet is:

-
        # perltidy -nmci
-        $self->blurt( "Error: No INPUT definition for type '$type', typekind '"
-              . $type->xstype
-              . "' found" );
+
    # perltidy -nmci
+    $self->blurt( "Error: No INPUT for type '$type', typekind '"
+          . $type->xstype
+          . "' found" );

The second and third lines are one level deep in a container, and are also statement continuations, so they get indented by the sum of the full indentation -i value and the continuation indentation -ci value. If this flag is set, the indentation is reduced by -ci spaces, giving

-
        # perltidy -mci
-        $self->blurt( "Error: No INPUT definition for type '$type', typekind '"
-            . $type->xstype
-            . "' found" );
+
    # perltidy -mci
+    $self->blurt( "Error: No INPUT for type '$type', typekind '"
+        . $type->xstype
+        . "' found" );

This flag is off by default.

@@ -765,10 +765,10 @@

A second optional item of information which can be given for parentheses is an alphanumeric letter which is used to limit the selection further depending on the type of token immediately before the paren. The possible letters are currently 'k', 'K', 'f', 'F', 'w', and 'W', with these meanings for matching whatever precedes an opening paren:

-
 'k' matches if the previous nonblank token is a perl built-in keyword
+
 'k' matches if the previous nonblank token is a perl keyword
      (such as 'if', 'while'),
- 'K' matches if 'k' does not, meaning that the previous token is not a keyword.
- 'f' matches if the previous token is a function other than a keyword.
+ 'K' matches if 'k' does not: previous token is not a keyword
+ 'f' matches if previous token is a function (not a keyword)
  'F' matches if 'f' does not.
  'w' matches if either 'k' or 'f' match.
  'W' matches if 'w' does not.
@@ -793,8 +793,8 @@
  '0' or blank: no restriction is placed on container contents
   '1' the container contents must be a simple list without sublists
-  '2' the container contents must be a simple list without sublists, without
-      code blocks, and without ternary operators
+ '2' the container contents must be a simple list without sublists, + without code blocks, and without ternary operators

For example,

@@ -878,14 +878,14 @@

Normally, lines of code contained within a pair of block braces receive one additional level of indentation. This flag, which is enabled by default, causes perltidy to look for opening block braces which are followed by a special side comment. This special side comment is #<<< by default. If found, the code between this opening brace and its corresponding closing brace will not be given the normal extra indentation level. For example:

-
            { #<<<   a closure to contain lexical vars
+
        { #<<<   a closure to contain lexical vars
 
-            my $var;  # this line does not get one level of indentation
-            ...
+        my $var;  # this line does not get one level of indentation
+        ...
 
-            }
+        }
 
-            # this line does not 'see' $var;
+ # this line does not 'see' $var;

This can be useful, for example, when combining code from different files. Different sections of code can be placed within braces to keep their lexical variables from being visible to the end of the file. To keep the new braces from causing all of their contained code to be indented if you run perltidy, and possibly introducing new line breaks in long lines, you can mark the opening braces with this special side comment.

@@ -1005,19 +1005,51 @@ $obj->{ $parsed_sql->{'table'}[0] }; # -bt=1 (default) $obj->{$parsed_sql->{'table'}[0]}; # -bt=2
-

And finally, curly braces which contain blocks of code are controlled by the parameter -bbt=n or --block-brace-tightness=n as illustrated in the example below.

+

And finally, curly braces which contain blocks of code are controlled by the parameter -bbt=n or --block-brace-tightness=n as illustrated in the example below (-bbt=0 is the default).

-
 %bf = map { $_ => -M $_ } grep { /\.deb$/ } dirents '.'; # -bbt=0 (default)
+
 %bf = map { $_ => -M $_ } grep { /\.deb$/ } dirents '.'; # -bbt=0
  %bf = map { $_ => -M $_ } grep {/\.deb$/} dirents '.';   # -bbt=1
  %bf = map {$_ => -M $_} grep {/\.deb$/} dirents '.';     # -bbt=2
-

To simplify input in the case that all of the tightness flags have the same value <n>, the parameter <-act=n> or --all-containers-tightness=n is an abbreviation for the combination <-pt=n -sbt=n -bt=n -bbt=n>.

+

To simplify input in the case that all of the tightness flags have the same value n, the parameter -act=n or --all-containers-tightness=n is an abbreviation for the combination -pt=n -sbt=n -bt=n -bbt=n.

+ + +
-mutt=s, --multiple-token-tightness=s
+
+ +

To review, the tightness controls described in the previous section have three possible integer values: 0, 1, and 2, where n=0 always adds a space, and n=2 never adds a space.

+ +

The default value n=1 adds space only if the container holds multiple tokens. Some perltidy tokens may be rather long, and it can be preferable to space some of them as if they were multple tokens. This can be done with this paramter.

+ +

For example, in the following expression the qw list is a single token and therefore there the default formatting does not put spaces within the square brackets:

+ +
    my $rlist = [qw(alpha beta gamma)];
+ +

This can be changed with

+ +
    # perltidy -mutt='qw'
+    my $rlist = [ qw(alpha beta gamma) ];
+ +

This tells perltidy to space a qwlist as if it were multiple tokens when the default tightness is used.

+ +

The parameter s may contain any of the following perl operators:

+ +
    qw q qq qx qr s y tr m
+ +

Other possible specifications are

+ +
    q*   - all of the above operators
+    Q    - all of the above plus any quoted text
+    h    - a here-doc target, such as '<<EOT'
+    <<>> - the double-diamond operator
+ +

A symbol may be negated by preceding it with a carat ^ symbol. The double-diamond operator is always included unless negated in this way.

-xbt, --extended-block-tightness
-

The previous section described two controls for spacing within curly braces, namely --block-brace-tightness=n for code block braces and --brace-tightness=n for all other braces.

+

There are two controls for spacing within curly braces, namely --block-brace-tightness=n for code block braces and --brace-tightness=n for all other braces.

There is a little fuzziness in this division of brace types though because the curly braces considered by perltidy to contain code blocks for formatting purposes, such as highlighting code structure, exclude some of the small code blocks used by Perl mainly for isolating terms. These include curly braces following a keyword where an indirect object might occur, or curly braces following a type symbol. For example, perltidy does not mark the following braces as code block braces:

@@ -1046,11 +1078,11 @@

Examples:

-
   -xbtl='k'          # selects just the keywords [DEFAULT]
-   -xbtl="t"          # selects just the special type symbols
-   -xbtl="k t"        # selects all keywords and symbols, or more simply
-   -xbtl="kt"         # selects all keywords and symbols
-   -xbtl="print say"  # selects just keywords B<print> and B<say>:
+
  -xbtl='k'          # selects just the keywords [DEFAULT]
+  -xbtl="t"          # selects just the special type symbols
+  -xbtl="k t"        # selects all keywords and symbols, or simply
+  -xbtl="kt"         # selects all keywords and symbols
+  -xbtl="print say"  # selects just keywords B<print> and B<say>:

Here are some formatting examples using the default values of --brace-tightness=n and --block-brace-tightness=n. Note that in these examples $ref is in block braces but $key is not.

@@ -1229,15 +1261,15 @@

For another example, the following two lines will be parsed without syntax error:

  # original programming, syntax ok
-  for my $severity ( reverse $SEVERITY_LOWEST+1 .. $SEVERITY_HIGHEST ) { ...  }
+  for my $severity ( reverse $LOWEST+1 .. $HIGHEST ) { ...  }
 
   # perltidy default, syntax ok
-  for my $severity ( reverse $SEVERITY_LOWEST + 1 .. $SEVERITY_HIGHEST ) { ... }
+ for my $severity ( reverse $LOWEST + 1 .. $HIGHEST ) { ... }

But the following will give a syntax error:

  # perltidy -nwrs='+', syntax error:
-  for my $severity ( reverse $SEVERITY_LOWEST +1 .. $SEVERITY_HIGHEST ) { ... }
+ for my $severity ( reverse $LOWEST +1 .. $HIGHEST ) { ... }

To avoid subtle parsing problems like this, it is best to avoid spacing a binary operator asymmetrically with a space on the left but not on the right.

@@ -1521,13 +1553,13 @@

This parameter causes perltidy to ignore the length of side comments when setting line breaks. The default, -niscl, is to include the length of side comments when breaking lines to stay within the length prescribed by the -l=n maximum line length parameter. For example, the following long single line would remain intact with -l=80 and -iscl:

     perltidy -l=80 -iscl
-        $vmsfile =~ s/;[\d\-]*$//; # Clip off version number; we can use a newer version as well
+ $vmsfile =~ s/;[\d\-]*$//; # Clip off version number; we can use a newer version

whereas without the -iscl flag the line will be broken:

     perltidy -l=80
         $vmsfile =~ s/;[\d\-]*$//
-          ;    # Clip off version number; we can use a newer version as well
+ ; # Clip off version number; we can use a newer version
-ipc, --ignore-perlcritic-comments
@@ -1825,7 +1857,7 @@

--code-skipping uses starting and ending markers '#<<V' and '#>>V', like this:

-
 #<<V  code skipping: perltidy will pass this verbatim without error checking
+
 #<<V  code skipping: perltidy passes this verbatim, no error checking
 
     token ident_digit {
         [ [ <?word> | _ | <?digit> ] <?ident_digit>
@@ -1870,9 +1902,9 @@
 
 

Some examples show how example strings become patterns:

-
 -fsb='#\{\{\{' becomes /^#\{\{\{\s/  which matches  #{{{ but not #{{{{
- -fsb='#\*\*'   becomes /^#\*\*\s/    which matches  #** but not #***
- -fsb='#\*{2,}' becomes /^#\*{2,}\s/  which matches  #** and #*****
+
 -fsb='#\{\{\{' becomes /^#\{\{\{\s/ which matches #{{{ but not #{{{{
+ -fsb='#\*\*'   becomes /^#\*\*\s/   which matches #** but not #***
+ -fsb='#\*{2,}' becomes /^#\*{2,}\s/ which matches #** and #*****
-fse=string, --format-skipping-end=string
@@ -1918,10 +1950,12 @@

Examples:

-
  -line-range-tidy=43:109      # tidy lines 43 through 109
-  -line-range-tidy=' 43 : 109' # tidy lines 43 through 109 (spaces ok in quotes)
-  -line-range-tidy=1:          # tidy all lines
-  -line-range-tidy=0:90        # ERROR (n1 must be >= 1)
+
 --line-range-tidy=43:109      # tidy lines 43 through 109
+ --line-range-tidy=' 43 : 109' # tidy lines 43 through 109
+ --line-range-tidy=1:          # tidy all lines
+ --line-range-tidy=0:90        # ERROR (n1 must be >= 1)
+ +

The second example shows that spaces are okay if placed in quotes.

@@ -2038,8 +2072,8 @@

Cuddled formatting is only possible between a pair of code blocks if the closing brace of the first block starts a new line. If a block is encountered which is entirely on a single line, and cuddled formatting is selected, it is necessary to make a decision as to whether or not to "break" the block, meaning to cause it to span multiple lines. This parameter controls that decision. The options are:

   cbo=0  Never force a short block to break.
-   cbo=1  If the first of a pair of blocks is broken in the input file,
-          then break the second [DEFAULT].
+   cbo=1  If the first of a pair of blocks is broken in the input
+          file, then break the second [DEFAULT].
    cbo=2  Break open all blocks for maximal cuddled formatting.

The default and recommended value is cbo=1. With this value, if the starting block of a chain spans multiple lines, then a cascade of breaks will occur for remaining blocks causing the entire chain to be cuddled.

@@ -2390,10 +2424,10 @@

If the trailing code requires multiple lines, then

  -bfvt=0 Insert a line break
-  -bfvt=1 Insert a line break except for a cuddled block chain [Default]
+  -bfvt=1 Insert a line break except for a cuddled block chain
   -bfvt=2 Do not insert a line break
-

So the most compact code is achieved with -bfvt=2.

+

The default is -bfvt=1. The most compact code is achieved with -bfvt=2.

Example (non-cuddled, multiple lines ):

@@ -2483,33 +2517,33 @@

Here is an example illustrating a welded container within a welded containers:

-
        # default formatting
-        $x->badd(
-            bmul(
-                $class->new(
-                    abs(
-                        $sx * int( $xr->numify() ) & $sy * int( $yr->numify() )
-                    )
-                ),
-                $m
-            )
-        );
-
-        # perltidy -wn
-        $x->badd( bmul(
-            $class->new( abs(
-                $sx * int( $xr->numify() ) & $sy * int( $yr->numify() )
-            ) ),
+
    # default formatting
+    $x->badd(
+        bmul(
+            $class->new(
+                abs(
+                    $sx * int( $xr->num() ) & $sy * int( $yr->num() )
+                )
+            ),
             $m
-        ) );
+ ) + ); + + # perltidy -wn + $x->badd( bmul( + $class->new( abs( + $sx * int( $xr->num() ) & $sy * int( $yr->num() ) + ) ), + $m + ) );

The welded closing tokens are by default on a separate line but this can be modified with the --vertical-tightness-closing=n (-vtc=n) flag (described in the next section). For example, the same example adding -vtc=2 is

-
        # perltidy -wn -vtc=2
-        $x->badd( bmul(
-            $class->new( abs(
-                $sx * int( $xr->numify() ) & $sy * int( $yr->numify() ) ) ),
-            $m ) );
+
    # perltidy -wn -vtc=2
+    $x->badd( bmul(
+        $class->new( abs(
+            $sx * int( $xr->num() ) & $sy * int( $yr->num() ) ) ),
+        $m ) );

This format option is quite general but there are some limitations.

@@ -2569,25 +2603,26 @@

A third optional item of information which can be given is an alphanumeric letter which is used to limit the selection further depending on the type of token immediately before the container. If given, it goes just before the container symbol. The possible letters are currently 'k', 'K', 'f', 'F', 'w', and 'W', with these meanings:

-
 'k' matches if the previous nonblank token is a perl built-in keyword (such as 'if', 'while'),
- 'K' matches if 'k' does not, meaning that the previous token is not a keyword.
- 'f' matches if the previous token is a function other than a keyword.
- 'F' matches if 'f' does not.
- 'w' matches if either 'k' or 'f' match.
- 'W' matches if 'w' does not.
+
 'k' matches if the previous nonblank token is a perl keyword
+     (such as 'if', 'while'),
+ 'K' matches if 'k' does not: previous token is not a keyword
+ 'f' matches if previous token is a function (not a keyword)
+ 'F' matches if 'f' does not
+ 'w' matches if either 'k' or 'f' match
+ 'W' matches if 'w' does not

For example, compare

        # perltidy -wn
         if ( defined( $_Cgi_Query{
-            $Config{'methods'}{'authentication'}{'remote'}{'cgi'}{'username'}
+            $Config{'methods'}{'auth'}{'remote'}{'cgi'}{'username'}
         } ) )

with

        # perltidy -wn -wnxl='^K( {'
         if ( defined(
-            $_Cgi_Query{ $Config{'methods'}{'authentication'}{'remote'}{'cgi'}
+            $_Cgi_Query{ $Config{'methods'}{'auth'}{'remote'}{'cgi'}
                   {'username'} }
         ) )
@@ -2595,14 +2630,14 @@

Here are some additional example strings and their meanings:

-
    '^('   - the weld must not start with a paren
-    '.('   - the second and later tokens may not be parens
-    '.w('  - the second and later tokens may not keyword or function call parens
-    '('    - no parens in a weld
-    '^K('  - exclude a leading paren preceded by a non-keyword
-    '.k('  - exclude a secondary paren preceded by a keyword
-    '[ {'  - exclude all brackets and braces
-    '[ ( ^K{' - exclude everything except nested structures like do {{  ... }}
+
 '^('   - the weld must not start with a paren
+ '.('   - second and later tokens may not be parens
+ '.w('  - second and later tokens may not be a keyword or call parens
+ '('    - no parens in a weld
+ '^K('  - exclude a leading paren preceded by a non-keyword
+ '.k('  - exclude a secondary paren preceded by a keyword
+ '[ {'  - exclude all brackets and braces
+ '[ ( ^K{' - exclude all except nested structures like do {{  ... }}
Vertical tightness of non-block curly braces, parentheses, and square brackets.
@@ -2686,26 +2721,26 @@

The difference between -vt=1 and -vt=2 is shown here:

-
    # perltidy -lp -vt=1
-    $init->add(
-                mysprintf( "(void)find_threadsv(%s);",
-                           cstring( $threadsv_names[ $op->targ ] )
-                )
-    );
+
  # perltidy -lp -vt=1
+  $init->add(
+              mysprintf( "(void)find_threadsv(%s);",
+                         cstring( $threadsv_names[ $op->targ ] )
+              )
+  );
 
-    # perltidy -lp -vt=2
-    $init->add( mysprintf( "(void)find_threadsv(%s);",
-                           cstring( $threadsv_names[ $op->targ ] )
-                )
-    );
+ # perltidy -lp -vt=2 + $init->add( mysprintf( "(void)find_threadsv(%s);", + cstring( $threadsv_names[ $op->targ ] ) + ) + );

With -vt=1, the line ending in add( does not combine with the next line because the next line is not balanced. This can help with readability, but -vt=2 can be used to ignore this rule.

The tightest, and least readable, code is produced with both -vt=2 and -vtc=2:

-
    # perltidy -lp -vt=2 -vtc=2
-    $init->add( mysprintf( "(void)find_threadsv(%s);",
-                           cstring( $threadsv_names[ $op->targ ] ) ) );
+
  # perltidy -lp -vt=2 -vtc=2
+  $init->add( mysprintf( "(void)find_threadsv(%s);",
+                         cstring( $threadsv_names[ $op->targ ] ) ) );

Notice how the code in all of these examples collapses vertically as -vt increases, but the indentation remains unchanged. This is because perltidy implements the -vt parameter by first formatting as if -vt=0, and then simply overwriting one output line on top of the next, if possible, to achieve the desired vertical tightness. The -lp (--line-up-parentheses) indentation style has been designed to allow this vertical collapse to occur, which is why it is required for the -vt parameter.

@@ -2936,13 +2971,13 @@

This formatting loses the nice structure. The original line breaks can be retained by adding comment or a blank line somewhere between the two parens. For example,

-
    my @list = (
-        1,    # a side comment forces the original line breakpoints to be kept
-        1, 1,
-        1, 2, 1,
-        1, 3, 3, 1,
-        1, 4, 6, 4, 1,
-    );
+
  my @list = (
+      1,    # a side comment forces the original breakpoints to be kept
+      1, 1,
+      1, 2, 1,
+      1, 3, 3, 1,
+      1, 4, 6, 4, 1,
+  );

We could achieve the same result with a blank line or full comment anywhere between the opening and closing parens. Vertical alignment of the list items will still occur if possible. The blank line method is shown here:

@@ -3010,7 +3045,7 @@ '<Page_Down>' => xx, );
-

Afterwards, we could switch to btct=b since the trailing comma is now bare. But the -btct parameter must be retained in this case because otherwise this small list will be flattened the next time it is formatted.

+

Afterwards, we could switch to -btct='b' since the trailing comma is now bare. But the -btct parameter must be retained in this case because otherwise this small list will be flattened the next time it is formatted.

This logic can be restricted to specific container types by including an opening token ahead of the letter in the above table. For example

@@ -3020,9 +3055,10 @@

For parentheses, an additional item of information which can be given is an alphanumeric letter which is used to limit the selection further depending on the type of token immediately before the opening paren. The possible letters are currently 'k', 'K', 'f', 'F', 'w', and 'W', with these meanings for matching whatever precedes an opening paren:

-
 'k' matches if the previous nonblank token is a perl built-in keyword
- 'K' matches if 'k' does not, meaning that the previous token is not a keyword.
- 'f' matches if the previous token is a function other than a keyword.
+
 'k' matches if the previous nonblank token is a perl keyword
+     (such as 'if', 'while'),
+ 'K' matches if 'k' does not: previous token is not a keyword
+ 'f' matches if previous token is a function (not a keyword)
  'F' matches if 'f' does not.
  'w' matches if either 'k' or 'f' match.
  'W' matches if 'w' does not.
@@ -3100,7 +3136,7 @@

This option tells perltidy to format a qw list which is delimited with parentheses as if it were a function call whose call args are a list of quoted items. Normally, a qw list is output verbatim except for an adjustment of leading whitespace to indicate the indentation level. For example, here is an example of the default formatting of a poorly formatted qw list:

    # perltidy
-    @fields = qw( $st_dev          $st_ino    $st_mode $st_nlink   $st_uid
+    @fields = qw( $st_dev     $st_ino    $st_mode $st_nlink   $st_uid
       $st_gid $st_rdev    $st_size $st_atime   $st_mtime  $st_ctime
       $st_blksize $st_blocks);
@@ -3177,7 +3213,7 @@

This option is on by default. Use -ndrc to turn it off.

-
--want-trailing-commas=s or -wtc=s, --add-trailing-commas or -atc, and --delete-trailing-commas or -dtc
+
Adding and Deleting Trailing Commas

A trailing comma is a comma following the last item of a list. Perl allows trailing commas but they are not required. Including them can sometimes simplify the maintenance of large or complex lists, and help display structure. But they may not be appropriate in all lists, for example in a list which always has just one term. By default, perltidy does not add or delete trailing commas, but it is possible to manipulate them with the following set of related parameters:

@@ -3197,14 +3233,15 @@

The parameter --want-trailing-commas=s, or -wtc=s, defines a preferred style. The string s indicates which lists should get trailing commas, as follows:

-
  s=1 or '*' : every list
-  s=m a multiline list
-  s=b a multiline list with bare trailing comma
-  s=i a multiline list with bare trailing comma and about one comma per line
-  s=h a multiline list with bare trailing comma and about one key=>value pair per line
-  s=0 : no list
+
 s=1 or '*' : every list
+ s=m a multiline list
+ s=b a multiline list, bare trailing comma
+ s=i a multiline list, bare trailing comma, about one comma per line
+ s=h a multiline list, bare trailing comma, about one key=>value
+       pair per line
+ s=0 : no list
 
-  s=' ' or -wtc not defined : leave trailing commas unchanged [DEFAULT].
+ s=' ' or not defined : leave trailing commas unchanged [DEFAULT]

where:

@@ -3234,16 +3271,16 @@

Here are some example parameter combinations and their meanings

-
  -wtc=0 -dtc   : delete all trailing commas
-  -wtc=1 -atc   : add trailing commas to all lists
-  -wtc=m -atc   : add trailing commas to all multiline lists
-                  (single line lists remain unchanged)
-  -wtc=b -atc   : add commas as necessary so that all lists whose
-                  closing bracket starts a new line have trailing commas
-  -wtc=b -dtc   : all trailing commas which are not bare
-                  (not followed by a newline) get deleted.
-  -wtc=b -atc -dtc  : do both of the above operations so that
-                      all trailing commas are bare
+
 -wtc=0 -dtc   : delete all trailing commas
+ -wtc=1 -atc   : add trailing commas to all lists
+ -wtc=m -atc   : add trailing commas to all multiline lists
+                 (single line lists remain unchanged)
+ -wtc=b -atc   : add commas so that all lists whose closing
+                 bracket starts a new line have trailing commas
+ -wtc=b -dtc   : all trailing commas which are not bare
+                 (not followed by a newline) get deleted.
+ -wtc=b -atc -dtc  : do both of the above operations so that
+                     all trailing commas are bare

For example, given the following input

@@ -3270,9 +3307,10 @@

For parentheses, an additional item of information which can be given is an alphanumeric letter which is used to limit the selection further depending on the type of token immediately before the opening paren. The possible letters are currently 'k', 'K', 'f', 'F', 'w', and 'W', with these meanings for matching whatever precedes an opening paren:

-
 'k' matches if the previous nonblank token is a perl built-in keyword
- 'K' matches if 'k' does not, meaning that the previous token is not a keyword.
- 'f' matches if the previous token is a function other than a keyword.
+
 'k' matches if the previous nonblank token is a perl keyword
+     (such as 'if', 'while'),
+ 'K' matches if 'k' does not: previous token is not a keyword
+ 'f' matches if previous token is a function (not a keyword)
  'F' matches if 'f' does not.
  'w' matches if either 'k' or 'f' match.
  'W' matches if 'w' does not.
@@ -3321,15 +3359,13 @@

because comma changes are based on the line breaks after the first iteration.

-

The additional computer time needed by the --converge option to do another iteration or two will not be noticeable except for files with many thousands of lines.

-

A parameter --delay-trailing-comma-operations, or -dtco, is available to control this behavior if desired. Negating this parameter, with -ndtco, tells perltidy to always use the starting state to make decisions regarding comma addition and deletion, even when iterations are requested. This should not normally be necessary.

  • Perltidy does not add a trailing comma in some edge cases which appear to be near a stability limit. So if a comma is unexpectedly not added, this is probably the reason.

  • -
  • If the parameter --break-at-trailing-comma-types is also employed, it operates on the state after any adding or deleting of commas. And it will allow trailing commas to be added in most edge cases. For example, given the following input text

    +
  • If the parameter --break-at-trailing-comma-types, or -btct. is also employed, it operates on the state after any adding or deleting of commas. And it will allow trailing commas to be added in most edge cases. For example, given the following input text

        plot(
             'g', Canvas => $overview_canvas
    @@ -3405,7 +3441,7 @@
             },
         );
    -

    But it turns out that these cases usually coincide with situations where the --weld-nested-containers, or -wn, would apply, and adding such commas can block welding. For example, the -wn parameter would succeed on the first of the above snippets, but it would fail on the second because of the added trailing comma.

    +

    But it turns out that these cases usually coincide with situations where the --weld-nested-containers, or -wn, parameter would apply, and adding such commas can block welding. For example, the -wn parameter would succeed on the first of the above snippets, but it would fail on the second because of the added trailing comma.

    The parameter --add-lone-trailing-commas, or -altc allows these commas to be added, provide that --add-trailing-commas is also set. It is on by default. Users of -wn may want to turn it off with --noadd-lone-trailing-commas, -naltc to prevent such commas from being added.

    @@ -3455,7 +3491,7 @@

    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'};
    +
       return $self->{'commandline'}->{'args'}->[0]->[0]->{'hgroups'};

    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.

    @@ -3467,7 +3503,7 @@

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

        # perltidy -dia
    -    return $self->{'commandline'}{'arg_list'}[0][0]{'hostgroups'};
    + return $self->{'commandline'}{'args'}[0][0]{'hgroups'};
  • By default this applies to all interbracket arrows, but selective deletion is possible with controls described below.

    @@ -3478,7 +3514,7 @@

    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'};
    + return $self->{'commandline'}->{'args'}->[0]->[0]->{'hgroups'};

    Selective changes can be made with controls described below.

    @@ -3544,16 +3580,16 @@

    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
    +
     n=0  the left container must contain 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
    +
     # 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.

    @@ -3663,17 +3699,17 @@

    For example, given this snippet:

        return unless $cmd = $cmd || ($dot
    -        && $Last_Shell) || &prompt('|');
    +        && $Last) || &prompt('|');
     
         # perltidy -bol [default]
         return
           unless $cmd = $cmd
           || ( $dot
    -        && $Last_Shell )
    +        && $Last )
           || &prompt('|');
     
         # perltidy -nbol
    -    return unless $cmd = $cmd || ( $dot && $Last_Shell ) || &prompt('|');
    + return unless $cmd = $cmd || ( $dot && $Last ) || &prompt('|');
    -bom, --break-at-old-method-breakpoints
    @@ -3681,31 +3717,28 @@

    By default, a method call arrow -> is considered a candidate for a breakpoint, but method chains will fill to the line width before a break is considered. With -bom, breaks before the arrow are preserved, so if you have pre-formatted a method chain:

    -
      my $q = $rs
    -    ->related_resultset('CDs')
    -    ->related_resultset('Tracks')
    -    ->search({
    -      'track.id' => {-ident => 'none_search.id'},
    -    })->as_query;
    +
        # perltidy -bom
    +    $Document
    +      ->schild(0)
    +      ->schildren();
    -

    It will keep these breaks, rather than become this:

    +

    the flag -bom will keep these line breaks, rather than become this:

    -
      my $q = $rs->related_resultset('CDs')->related_resultset('Tracks')->search({
    -      'track.id' => {-ident => 'none_search.id'},
    -    })->as_query;
    +
        # perltidy [DEFAULT]
    +    $Document->schild(0)->schildren();

    This flag will also look for and keep a 'cuddled' style of calls, in which lines begin with a closing paren followed by a call arrow, as in this example:

    -
      # perltidy -bom -wn
    -  my $q = $rs->related_resultset(
    -      'CDs'
    -  )->related_resultset(
    -      'Tracks'
    -  )->search( {
    -      'track.id' => { -ident => 'none_search.id' },
    -  } )->as_query;
    - -

    You may want to include the --weld-nested-containers flag in this case to keep nested braces and parens together, as in the last line.

    +
        # perltidy -bom
    +    my $q = $rs->related_resultset(
    +        'CDs'
    +    )->related_resultset(
    +        'Tracks'
    +    )->search(
    +        {
    +            'track.id' => { -ident => 'none_search.id' },
    +        }
    +    )->as_query;
    -bos, --break-at-old-semicolon-breakpoints
    @@ -3720,7 +3753,7 @@
      $z = sqrt( $x**2 + $y**2 );
    -

    Using the <-bos> flag keeps the isolated semicolon:

    +

    Using the -bos flag keeps the isolated semicolon:

      # perltidy -bos
       $z = sqrt( $x**2 + $y**2 )
    @@ -3804,10 +3837,10 @@
     
     

    It is possible to be more specific in matching parentheses by preceding them with a letter. The possible letters are 'k', 'K', 'f', 'F', 'w', and 'W', with these meanings (these are the same as used in the --weld-nested-exclusion-list and --line-up-parentheses-exclusion-list parameters):

    -
     'k' matches if the previous nonblank token is a perl built-in keyword
    +
     'k' matches if the previous nonblank token is a perl keyword
          (such as 'if', 'while'),
    - 'K' matches if 'k' does not, meaning that the previous token is not a keyword.
    - 'f' matches if the previous token is a function other than a keyword.
    + 'K' matches if 'k' does not: previous token is not a keyword
    + 'f' matches if previous token is a function (not a keyword)
      'F' matches if 'f' does not.
      'w' matches if either 'k' or 'f' match.
      'W' matches if 'w' does not.
    @@ -3895,7 +3928,7 @@
    -blbs=n, --blank-lines-before-subs=n
    -

    The parameter -blbs=n requests that least n blank lines precede a sub definition which does not follow a comment and which is more than one-line long. The default is <-blbs=1>. BEGIN and END blocks are included.

    +

    The parameter -blbs=n requests that least n blank lines precede a sub definition which does not follow a comment and which is more than one-line long. The default is -blbs=1. BEGIN and END blocks are included.

    The requested number of blanks statement will be inserted regardless of the value of --maximum-consecutive-blank-lines=n (-mbl=n) with the exception that if -mbl=0 then no blanks will be output.

    @@ -4007,8 +4040,8 @@

    The possible values of n are:

     n=0 ignore all old blank lines
    - n=1 stable: keep old blanks, but limited by the value of the B<-mbl=n> flag
    - n=2 keep all old blank lines, regardless of the value of the B<-mbl=n> flag
    + n=1 stable: keep old blanks, but limited by the B<-mbl=n> flag + n=2 keep all old blank lines, regardless of the B<-mbl=n> flag

    The default is n=1.

    @@ -4053,38 +4086,38 @@

    Before describing the meaning of the parameters in detail let us look at an example which is formatted with default parameter settings.

    -
            print "Entering test 2\n";
    -        use Test;
    -        use Encode qw(from_to encode decode
    -          encode_utf8 decode_utf8
    -          find_encoding is_utf8);
    -        use charnames qw(greek);
    -        my @encodings     = grep( /iso-?8859/, Encode::encodings() );
    -        my @character_set = ( '0' .. '9', 'A' .. 'Z', 'a' .. 'z' );
    -        my @source        = qw(ascii iso8859-1 cp1250);
    -        my @destiny       = qw(cp1047 cp37 posix-bc);
    -        my @ebcdic_sets   = qw(cp1047 cp37 posix-bc);
    -        my $str           = join( '', map( chr($_), 0x20 .. 0x7E ) );
    -        return unless ($str);
    +
        print "Entering test 2\n";
    +    use Test;
    +    use Encode qw(from_to encode decode
    +      encode_utf8 decode_utf8
    +      find_encoding is_utf8);
    +    use charnames qw(greek);
    +    my @encodings     = grep( /iso-?8859/, Encode::encodings() );
    +    my @character_set = ( '0' .. '9', 'A' .. 'Z', 'a' .. 'z' );
    +    my @source        = qw(ascii iso8859-1 cp1250);
    +    my @destiny       = qw(cp1047 cp37 posix-bc);
    +    my @ebcdic_sets   = qw(cp1047 cp37 posix-bc);
    +    my $str           = join( '', map( chr($_), 0x20 .. 0x7E ) );
    +    return unless ($str);

    using perltidy -kgb gives:

    -
            print "Entering test 2\n";
    -                                      <----------this blank controlled by -kgbb
    -        use Test;
    -        use Encode qw(from_to encode decode
    -          encode_utf8 decode_utf8
    -          find_encoding is_utf8);
    -        use charnames qw(greek);
    -                                      <---------this blank controlled by -kgbi
    -        my @encodings     = grep( /iso-?8859/, Encode::encodings() );
    -        my @character_set = ( '0' .. '9', 'A' .. 'Z', 'a' .. 'z' );
    -        my @source        = qw(ascii iso8859-1 cp1250);
    -        my @destiny       = qw(cp1047 cp37 posix-bc);
    -        my @ebcdic_sets   = qw(cp1047 cp37 posix-bc);
    -        my $str           = join( '', map( chr($_), 0x20 .. 0x7E ) );
    -                                      <----------this blank controlled by -kgba
    -        return unless ($str);
    +
        print "Entering test 2\n";
    +                              <----------this blank controlled by -kgbb
    +    use Test;
    +    use Encode qw(from_to encode decode
    +      encode_utf8 decode_utf8
    +      find_encoding is_utf8);
    +    use charnames qw(greek);
    +                              <---------this blank controlled by -kgbi
    +    my @encodings     = grep( /iso-?8859/, Encode::encodings() );
    +    my @character_set = ( '0' .. '9', 'A' .. 'Z', 'a' .. 'z' );
    +    my @source        = qw(ascii iso8859-1 cp1250);
    +    my @destiny       = qw(cp1047 cp37 posix-bc);
    +    my @ebcdic_sets   = qw(cp1047 cp37 posix-bc);
    +    my $str           = join( '', map( chr($_), 0x20 .. 0x7E ) );
    +                              <----------this blank controlled by -kgba
    +    return unless ($str);

    Blank lines have been introduced around the my and use sequences. What happened is that the default keyword list includes my and use but not print and return. So a continuous sequence of nine my and use statements was located. This number exceeds the default threshold of five, so blanks were placed before and after the entire group. Then, since there was also a subsequence of six my lines, a blank line was introduced to separate them.

    @@ -4168,7 +4201,8 @@

    -pbp is an abbreviation for the parameters in the book Perl Best Practices by Damian Conway:

    -
        -l=78 -i=4 -ci=4 -st -se -vt=2 -cti=0 -pt=1 -bt=1 -sbt=1 -bbt=1 -nsfs -nolq
    +
        -l=78 -i=4 -ci=4 -st -se -vt=2 -cti=0 -pt=1 -bt=1 -sbt=1 -bbt=1
    +    -nsfs -nolq
         -wbb="% + - * / x != == >= <= =~ !~ < > | & =
               **= += *= &= <<= &&= -= /= |= >>= ||= //= .= %= ^= x="
    @@ -4184,7 +4218,7 @@ ) . ( $page - ? ( $section ? ' in ' : '' ) . "the $page$page_ext manpage" + ? ( $section ? ' in ' : '' ) . "the $page_ext manpage" : ' elsewhere in this document' ); @@ -4196,7 +4230,7 @@ ) . ( $page - ? ( $section ? ' in ' : '' ) . "the $page$page_ext manpage" + ? ( $section ? ' in ' : '' ) . "the $page_ext manpage" : ' elsewhere in this document' ); @@ -4207,7 +4241,7 @@ : "the section on $section" ) . ( $page - ? ( $section ? ' in ' : '' ) . "the $page$page_ext manpage" + ? ( $section ? ' in ' : '' ) . "the $page_ext manpage" : ' elsewhere in this document' );
    @@ -4281,9 +4315,9 @@

    This flag controls the placement of semicolons at the end of one-line blocks. Semicolons are optional before a closing block brace, and frequently they are omitted at the end of a one-line block containing just a single statement. By default, perltidy follows the input file regarding these semicolons, but this behavior can be controlled by this flag. The values of n are:

    -
      n=0 remove terminal semicolons in one-line blocks having a single statement
    -  n=1 stable; keep input file placement of terminal semicolons [DEFAULT ]
    -  n=2 add terminal semicolons in all one-line blocks
    +
     n=0 remove terminal semicolons in single-statement one-line blocks
    + n=1 stable; keep input terminal semicolons [DEFAULT ]
    + n=2 add terminal semicolons in all one-line blocks

    Note that the n=2 option has no effect if adding semicolons is prohibited with the -nasc flag. Also not that while n=2 adds missing semicolons to all one-line blocks, regardless of complexity, the n=0 option only removes ending semicolons which terminate one-line blocks containing just one semicolon. So these two options are not exact inverses.

    @@ -4407,8 +4441,8 @@

    If it is simpler to specify only the token types which are to be aligned, then include the types which are to be aligned in the list of --valign-inclusion-list. In that case you may leave the valign-exclusion-list undefined, or use the special symbol * for the exclusion list. For example, the following parameters enable alignment only at commas and 'fat commas':

    -
      --valign-inclusion-list=', =>'
    -  --valign-exclusion-list='*'     ( this is optional and may be omitted )
    +
     --valign-inclusion-list=', =>'
    + --valign-exclusion-list='*'  ( this is optional and may be omitted )

    These parameter lists should consist of space-separated tokens from the above list of possible alignment tokens, or a '*'. If an unrecognized token appears, it is simply ignored. And if a specific token is entered in both lists by mistake then the exclusion list has priority.

    @@ -4419,24 +4453,24 @@

    To illustrate, consider the following snippet with default formatting

    -
        # perltidy
    -    $co_description = ($color) ? 'bold cyan'  : '';           # description
    -    $co_prompt      = ($color) ? 'bold green' : '';           # prompt
    -    $co_unused      = ($color) ? 'on_green'   : 'reverse';    # unused
    +
      # perltidy
    +  $co_description = ($color) ? 'bold cyan'  : '';           # descr
    +  $co_prompt      = ($color) ? 'bold green' : '';           # prompt
    +  $co_unused      = ($color) ? 'on_green'   : 'reverse';    # unused

    To exclude all alignments except the equals (i.e., include only equals) we could use:

    -
        # perltidy -vil='='
    -    $co_description = ($color) ? 'bold cyan' : '';          # description
    -    $co_prompt      = ($color) ? 'bold green' : '';         # prompt
    -    $co_unused      = ($color) ? 'on_green' : 'reverse';    # unused
    +
      # perltidy -vil='='
    +  $co_description = ($color) ? 'bold cyan' : '';          # descr
    +  $co_prompt      = ($color) ? 'bold green' : '';         # prompt
    +  $co_unused      = ($color) ? 'on_green' : 'reverse';    # unused

    To exclude only the equals we could use:

    -
        # perltidy -vxl='='
    -    $co_description = ($color) ? 'bold cyan' : '';     # description
    -    $co_prompt = ($color) ? 'bold green' : '';         # prompt
    -    $co_unused = ($color) ? 'on_green' : 'reverse';    # unused
    +
      # perltidy -vxl='='
    +  $co_description = ($color) ? 'bold cyan' : '';     # descr
    +  $co_prompt = ($color) ? 'bold green' : '';         # prompt
    +  $co_unused = ($color) ? 'on_green' : 'reverse';    # unused

    Notice in this last example that although only the equals alignment was excluded, the ternary alignments were also lost. This happens because the vertical aligner sweeps from left-to-right and usually stops if an important alignment cannot be made for some reason.

    @@ -4448,19 +4482,19 @@

    By default, postfix if terms align and postfix unless terms align, but separately. For example,

    -
        # perltidy [DEFAULT]
    -    print "Tried to add: @ResolveRPM\n" if ( @ResolveRPM and !$Quiet );
    -    print "Would need: @DepList\n"      if ( @DepList    and !$Quiet );
    -    print "RPM Output:\n"                 unless $Quiet;
    -    print join( "\n", @RPMOutput ) . "\n" unless $Quiet;
    +
      # perltidy [DEFAULT]
    +  print "Tried to add: @Resolve\n" if ( @Resolve and !$Quiet );
    +  print "Would need: @DepList\n"   if ( @DepList and !$Quiet );
    +  print "Output:\n"                  unless $Quiet;
    +  print join( "\n", @Output ) . "\n" unless $Quiet;
    -

    The -viu flag causes a postfix unless to be treated as if it were a postfix if for purposes of alignment. Thus

    +

    The -viu flag causes a postfix unless to be treated as if it were a postfix if for purposes of alignment, and thus they align:

    -
        # perltidy -viu
    -    print "Tried to add: @ResolveRPM\n"   if ( @ResolveRPM and !$Quiet );
    -    print "Would need: @DepList\n"        if ( @DepList    and !$Quiet );
    -    print "RPM Output:\n"                 unless $Quiet;
    -    print join( "\n", @RPMOutput ) . "\n" unless $Quiet;
    +
      # perltidy -viu
    +  print "Tried to add: @Resolve\n"   if ( @Resolve and !$Quiet );
    +  print "Would need: @DepList\n"     if ( @DepList and !$Quiet );
    +  print "Output:\n"                  unless $Quiet;
    +  print join( "\n", @Output ) . "\n" unless $Quiet;
    Aligning signed numbers with --valign-signed-numbers or -vsn
    @@ -4744,11 +4778,11 @@

    For a specific example, the following line

    -
            oneliner { --maximum-line-length=0 --noadd-newlines --noadd-terminal-newline}
    +
      oneliner { --maximum-line-length=0 --noadd-newlines --noadd-terminal-newline}

    or equivalently with abbreviations

    -
            oneliner { -l=0 -nanl -natnl }
    +
      oneliner { -l=0 -nanl -natnl }

    could be placed in a .perltidyrc file to temporarily override the maximum line length with a large value, to temporarily prevent new line breaks from being added, and to prevent an extra newline character from being added the file. All other settings in the .perltidyrc file still apply. Thus it provides a way to format a long 'one liner' when perltidy is invoked with

    @@ -4796,6 +4830,8 @@

    --dump-want-right-space or -dwrs will write the hash %want_right_space to standard output and quit. See the section on controlling whitespace around tokens.

    +

    See "Analyzing Code" for additional --dump- parameters.

    +
    @@ -4882,16 +4918,16 @@

    produces an output file blocks.csv whose lines hold these parameters:

    -
        filename     - the name of the file
    -    line         - the line number of the opening brace of this block
    -    line_count   - the number of lines between opening and closing braces
    -    code_lines   - the number of lines excluding blanks, comments, and pod
    -    type         - the block type (sub, for, foreach, ...)
    -    name         - the block name if applicable (sub name, label, asub name)
    -    depth        - the nesting depth of the opening block brace
    -    max_change   - the change in depth to the most deeply nested code block
    -    block_count  - the total number of code blocks nested in this block
    -    mccabe_count - the McCabe complexity measure of this code block
    +
      filename     - name of the file
    +  line         - line number of the opening brace of this block
    +  line_count   - number of lines between opening and closing braces
    +  code_lines   - number of lines excluding blanks, comments, and pod
    +  type         - block type (sub, for, foreach, ...)
    +  name         - block name if applicable (sub or asub name, label..)
    +  depth        - nesting depth of the opening block brace
    +  max_change   - change in depth to the most deeply nested code block
    +  block_count  - total number of code blocks nested in this block
    +  mccabe_count - McCabe complexity measure of this code block

    This feature was developed to help identify complex sections of code as an aid in refactoring. The McCabe complexity measure follows the definition used by Perl::Critic. By default the table contains these values for subroutines, but the user may request them for any or all blocks of code or packages. For blocks which are loops nested within loops, a postfix '+' to the type is added to indicate possible code complexity. Although the table does not otherwise indicate which blocks are nested in other blocks, this can be determined by computing and comparing the block ending line numbers.

    @@ -4910,7 +4946,7 @@ + - any nested inner block loop package - any package or class closure - any nameless block - elsif3 - an if-elsif-..-else chain with 3 or more elsif's (3 is arbitrary, see below)
    + elsif3 - an if-elsif- chain with 3 or more elsif's (see below)

    A chain of if-elsif-... blocks may be reported as a single line item by entering the word elsif with an appended integer, as indicated by the last item in this list. The integer indicates the number of elsif blocks required for a chain to be reported. If you use this, you may want to also use -dbl=n, with a smaller number of lines n than the default.

    @@ -5070,6 +5106,18 @@
        -wvxl='*_uu'
    + +
    Use --dump-unique-keys to help locate misspelled hash keys
    +
    + +

    The parameter --dump-unique-keys, or -duk, dumps a list of hash keys which appear to be used just once, and do not appear among the quoted strings in a file. For example:

    + +
       perltidy -duk File.pm >output.txt
    + +

    The lines in the output file list each unique key and its line number. Typically, most of the listed keys listed will be perfectly valid keys needed, for example, for communication with other modules or for future development. But the list might also include something unexpected, such as a misspelled key.

    + +

    A program dump_unique_keys.pl at https://github.com/perltidy/perltidy/tree/master/examples can run perltidy with -duk on multiple files, and then remove any common keys from the list.

    +
    Use --dump-mixed-call-parens to find functions called both with and without parens
    @@ -5172,7 +5220,7 @@
        sub gnab_gib {
             my $self = shift;
    -        my ( $v1, ($v2) ) = @_;  # <-- extra parens on $v2 indicate optional
    +        my ( $v1, ($v2) ) = @_;  # <-- $v2 is optional
             ...;
         }
    @@ -5182,8 +5230,8 @@

    For multiple default call args, place one set of parens around them all. Some examples:

    -
        my ( $v1, ( $v2, $v3 ) ) = @_;    # <-- $v2 and $v3 are optional
    -    my ( ($v1) ) = @_;                # <-- $v1 is optional
    +
        my ( ($v1) ) = @_;              # <-- $v1 is optional
    +    my ( $v1, ( $v2, $v3 ) ) = @_;  # <-- $v2, $v3 are optional
    i: indeterminate: a specific number of expected args for a sub could not be determined, but it is called with a specific number. This issue is reported for the --dump- option but not the --warn- option.
    @@ -5293,8 +5341,8 @@ ( $name, $flags ); # 2 values but no 'return' statement } - ( $name, $flags ) = macho(); # 'x' (want array but no return stmt) - $name = macho(); # 'y' (want scalar but no return stmt) + ( $name, $flags ) = macho(); # 'x' (want array, but no return) + $name = macho(); # 'y' (want scalar but no return) sub wimp { ...; @@ -5303,7 +5351,7 @@ ( $name, $flags, $access) = wimp(); # 'o' (want array 3 > 2) ($name) = wimp(); # 'u' (want array 1 < 2) - $name = wimp(); # 's' (want scalar but 2 values returned) + $name = wimp(); # 's' (want scalar but 2 values returned)

    This analysis works by scanning all call statements and all sub return statements, and comparing the the number of items wanted with the possible number of items returned. If a specific value for either of these numbers cannot be determined for a call then it cannot be checked.

    @@ -5367,7 +5415,7 @@
    The -pre flag for code snippets
    -

    When the -pre flag is given, only the pre-formatted section, within the <PRE> and </PRE> tags, will be output. This simplifies inclusion of the output in other files. The default is to output a complete web page.

    +

    When the -pre flag is given, only the pre-formatted section, within the <PRE> and </PRE> tags, will be output. This simplifies inclusion of the output in other files. The default is to output a complete web page.

    The -nnn flag for line numbering
    @@ -5561,20 +5609,20 @@ ce conv cpb cs csc cscb cscw dac dbc dbs dcbl dcsc ddf dia dior dln dltc dma dmcp dmr dnl dop dp dpro drc dsc dsm dsn dtc dtco - 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 mci 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 vwe w wfc wia wma wme wmr - wn x xbt xci xlp xs + dtt duk 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 ils iob ipc isbc + iscl kgb kgbd kgbi kis lal log lop lp lsl + mci mem nib ohbr okw ola olc oll olq opr + opt osbc osbr otr ple pod pvl q qwaf 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 vwe w wfc wia + wma wme wmr wn x xbt xci xlp xs

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

    @@ -5652,7 +5700,7 @@

    VERSION

    -

    This man page documents perltidy version 20240903.07

    +

    This man page documents perltidy version 20240903.09

    BUG REPORTS

    diff --git a/examples/dump_unique_keys.pl b/examples/dump_unique_keys.pl index 7cecffc6..cdd1176e 100755 --- a/examples/dump_unique_keys.pl +++ b/examples/dump_unique_keys.pl @@ -5,7 +5,7 @@ use File::Temp qw{ tempfile }; # Run perltidy --dump-unique-keys on multiple files, and # show hash keys which just appear in one file. -# Requires Perl::Tidy version 20240903.08 or higher +# Requires Perl::Tidy version 20240903.09 or higher main(); diff --git a/lib/Perl/Tidy.pm b/lib/Perl/Tidy.pm index 9cb8dfe9..80ccdf53 100644 --- a/lib/Perl/Tidy.pm +++ b/lib/Perl/Tidy.pm @@ -136,7 +136,7 @@ BEGIN { # then the Release version must be bumped, and it is probably past time for # a release anyway. - $VERSION = '20240903.08'; + $VERSION = '20240903.09'; } ## end BEGIN sub DESTROY { diff --git a/lib/Perl/Tidy.pod b/lib/Perl/Tidy.pod index 8f33f8c6..9cf056db 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 20240903.08 +This man page documents Perl::Tidy version 20240903.09 =head1 LICENSE diff --git a/lib/Perl/Tidy/Debugger.pm b/lib/Perl/Tidy/Debugger.pm index a3a540d3..ceaca3ff 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 = '20240903.08'; +our $VERSION = '20240903.09'; use constant EMPTY_STRING => q{}; use constant SPACE => q{ }; diff --git a/lib/Perl/Tidy/Diagnostics.pm b/lib/Perl/Tidy/Diagnostics.pm index 9f1ae80a..1a3775f8 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 = '20240903.08'; +our $VERSION = '20240903.09'; use constant EMPTY_STRING => q{}; diff --git a/lib/Perl/Tidy/FileWriter.pm b/lib/Perl/Tidy/FileWriter.pm index 8c0b29b2..015ea75d 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 = '20240903.08'; +our $VERSION = '20240903.09'; use Carp; use constant DEVEL_MODE => 0; diff --git a/lib/Perl/Tidy/Formatter.pm b/lib/Perl/Tidy/Formatter.pm index f93cabda..cfb5ab39 100644 --- a/lib/Perl/Tidy/Formatter.pm +++ b/lib/Perl/Tidy/Formatter.pm @@ -76,7 +76,7 @@ use constant BACKSLASH => q{\\}; use Carp; use English qw( -no_match_vars ); use List::Util qw( min max first ); # min, max first are in Perl 5.8 -our $VERSION = '20240903.08'; +our $VERSION = '20240903.09'; # The Tokenizer will be loaded with the Formatter ##use Perl::Tidy::Tokenizer; # for is_keyword() @@ -8860,9 +8860,9 @@ sub dump_unique_keys { }; ## end $add_known_keys = sub # Add keys which may be unique to this environment. - $add_known_keys->( \%SIG, '$SIG' ); - $add_known_keys->( \%ENV, '$ENV' ); - $add_known_keys->( \%!, '$!' ); + $add_known_keys->( \%SIG, '$SIG' ); + $add_known_keys->( \%ENV, '$ENV' ); + $add_known_keys->( \%ERRNO, '$!' ); my $is_known_hash = sub { my ($key) = @_; diff --git a/lib/Perl/Tidy/HtmlWriter.pm b/lib/Perl/Tidy/HtmlWriter.pm index a2ec1386..87120b54 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 = '20240903.08'; +our $VERSION = '20240903.09'; use Carp; use English qw( -no_match_vars ); diff --git a/lib/Perl/Tidy/IOScalar.pm b/lib/Perl/Tidy/IOScalar.pm index 77341f49..a8666ceb 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 = '20240903.08'; +our $VERSION = '20240903.09'; 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 146b5cca..5e1e5005 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 = '20240903.08'; +our $VERSION = '20240903.09'; use constant DEVEL_MODE => 0; diff --git a/lib/Perl/Tidy/IndentationItem.pm b/lib/Perl/Tidy/IndentationItem.pm index 68536b6a..d4fe09c5 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 = '20240903.08'; +our $VERSION = '20240903.09'; BEGIN { diff --git a/lib/Perl/Tidy/Logger.pm b/lib/Perl/Tidy/Logger.pm index 883accf8..6dd15b1f 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 = '20240903.08'; +our $VERSION = '20240903.09'; use Carp; use English qw( -no_match_vars ); diff --git a/lib/Perl/Tidy/Tokenizer.pm b/lib/Perl/Tidy/Tokenizer.pm index 8411f0c9..91410f13 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 = '20240903.08'; +our $VERSION = '20240903.09'; use Carp; diff --git a/lib/Perl/Tidy/VerticalAligner.pm b/lib/Perl/Tidy/VerticalAligner.pm index 39a53c33..f609b70f 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 = '20240903.08'; +our $VERSION = '20240903.09'; use English qw( -no_match_vars ); use Scalar::Util 'refaddr'; # perl 5.8.1 and later use Perl::Tidy::VerticalAligner::Alignment; diff --git a/lib/Perl/Tidy/VerticalAligner/Alignment.pm b/lib/Perl/Tidy/VerticalAligner/Alignment.pm index 55c626db..0991b137 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 = '20240903.08'; +our $VERSION = '20240903.09'; sub new { my ( $class, $rarg ) = @_; diff --git a/lib/Perl/Tidy/VerticalAligner/Line.pm b/lib/Perl/Tidy/VerticalAligner/Line.pm index ad0d58c1..4c509063 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 = '20240903.08'; +our $VERSION = '20240903.09'; use English qw( -no_match_vars ); sub AUTOLOAD { -- 2.39.5