]> git.donarmstrong.com Git - perltidy.git/commitdiff
update some comments and docs
authorSteve Hancock <perltidy@users.sourceforge.net>
Tue, 28 Feb 2023 22:40:01 +0000 (14:40 -0800)
committerSteve Hancock <perltidy@users.sourceforge.net>
Tue, 28 Feb 2023 22:40:01 +0000 (14:40 -0800)
CHANGES.md
lib/Perl/Tidy/Formatter.pm
lib/Perl/Tidy/Tokenizer.pm

index bcf9422d025490722d6f8aae127b62a5f847553c..ea965d2e90f68e2a186982408f676615ea92e26c 100644 (file)
@@ -2,6 +2,10 @@
 
 ## 2022 11 12.05
 
+    - No significant bugs have been found since the last release to CPAN.
+      Several minor issues have been fixed, and some new parameters have been
+      added, as follows:
+
     - Added parameter --one-line-block-exclusion-list=s, or -olbxl=s, where
       s is a list of block types which should not automatically be turned
       into one-line blocks.  This implements the issue raised in PR #111.
@@ -11,7 +15,7 @@
       would be -olbxl='eval'.
 
     - For the -b (--backup-and-modify-in-place) option, the file timestamps
-      are changing (issue rt#145999).  First, if there are no formatting
+      are changing (git #113, rt#145999).  First, if there are no formatting
       changes to an input file, it will keep its original modification time.
       Second, any backup file will keep its original modification time.  This
       was previously true for --backup-method=move but not for the default
       is --use-feature=class. If this causes a conflict, this option can
       be turned off by entering -uf=' '.
 
+      In other words, perltidy should work for both old and new uses of
+      these keywords with the default settings, but this flag is available
+      if a conflict arises.
+
     - Added option -bfvt=n, or --brace-follower-vertical-tightness=n,
       for part of issue git #110.  For n=2, this option looks for lines
       which would otherwise be, by default,
@@ -80,7 +88,7 @@
       The default is not to do this and can be indicated with n=1.
 
     - Added option -cpb, or --cuddled-paren-brace, for issue git #110.
-      This option  This will cause perltidy to join two lines which
+      This option will cause perltidy to join two lines which
       otherwise would be, by default,
 
         )
       ) {
 
     - Added option -dbs, or --dump-block-summary, to dump summary
-      information about code blocks in a file to standard output. The
-      man page file, bin/perltidy, has a description.
+      information about code blocks in a file to standard output.
+      Lines with the following comma-separated data items are dumped:
+
+       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
+
+      This is useful for code restructuring. The man page for perltidy has
+      more information.
+
+    - This version was stress-tested for over 100 cpu hours with random
+      input parameters. No failures to converge, internal fault checks,
+      undefined variable references or other irregularities were seen.
+
+    - This version runs about 4 percent faster than the previous
+      release on large files due to optimizations made with the help of
+      Devel::NYTProf.
 
 ## 2022 11 12
 
index f828753a3bc3ace7083523f837181ef497b0e4f6..50051a0639dad518ba18af09f7b2b25748d53e9c 100644 (file)
@@ -22458,7 +22458,7 @@ EOM
 
             # This option fixes b1240 but not b1235, b1237 with new -lp,
             # but this gives better formatting than the previous option.
-            # TODO: see if stress_level_alha should also be considered
+            # TODO: see if stress_level_alpha should also be considered
             $do_not_break_apart ||=
               $levels_to_go[$i_opening] > $stress_level_beta;
         }
@@ -30329,7 +30329,6 @@ sub add_closing_side_comment {
                         }
                         $cscw_block_comment =
 "## perltidy -cscw $timestamp: $tokens_to_go[$max_index_to_go]";
-## "## perltidy -cscw $year-$month-$day: $tokens_to_go[$max_index_to_go]";
                     }
                 }
 
index fcb59a3dba9a246dea45b8c157fdc9b987f97f98..abb3305e5322f799af7e8a3698fb1f6bf69f46bc 100644 (file)
@@ -4241,11 +4241,6 @@ EOM
             # Update for --use-feature=class (rt145706):
             # We have to be extra careful to avoid misparsing other uses of
             # 'method' in older scripts.
-
-            # TODO: This is just a preliminary version. A future version
-            # should add an option to silently parse as a sub and then
-            # on error backtrack and parse as a bareword.
-
             if ( $tok_kw eq 'method' ) {
                 if (   $expecting == OPERATOR
                     || $next_nonblank_token !~ /^(\w|\:)/