From 6dd21610c8b806b374dcc070e021e476590bcaf6 Mon Sep 17 00:00:00 2001 From: Steve Hancock Date: Fri, 30 Jun 2023 15:38:02 -0700 Subject: [PATCH] update to v20230701 --- CHANGES.md | 29 ++++++++++++-------- bin/perltidy | 8 +++--- docs/ChangeLog.html | 31 +++++++++++++--------- docs/Tidy.html | 2 +- docs/ci_update.md | 24 +++++++++-------- docs/perltidy.html | 6 ++--- lib/Perl/Tidy.pm | 2 +- 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 | 2 +- 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 | 2 +- lib/Perl/Tidy/VerticalAligner.pm | 2 +- lib/Perl/Tidy/VerticalAligner/Alignment.pm | 2 +- lib/Perl/Tidy/VerticalAligner/Line.pm | 2 +- local-docs/Release-Checklist.md | 2 +- 26 files changed, 78 insertions(+), 62 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 95d201b7..d6b7c503 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,18 +1,11 @@ # Perltidy Change Log -## 2023 03 09.04 - - - Add parameter -ipc, or --ignore-perlcritic-comments. Perltidy, by - default, will look for side comments beginning with ``## no critic`` and - ignore their lengths when making line break decisions, even if the user - has not set ``-iscl``. The reason is that an unwanted line break can - make these special comments ineffective in controlling ``perlcritic``. - The parameter -ipc can be set if, for some reason, this is not wanted. +## 2023 07 01 - Issue git #121. Added parameters -xbt, or --extended-block-tightness, and -xbtl=s, or --extended-block-tightness-list=s, to allow certain small code blocks to have internal spacing controlled by - -bbt=n instead of -bt=n. The man pages have details. + -bbt=n rather than -bt=n. The man pages have details. - Issue git #118. A warning will be issued if a duplicate format-skipping starting marker is seen within a format-skipping section. The same @@ -37,17 +30,31 @@ --dump-block-summary on a file without any subs or other selected block types. - - Some rare, minor issues with continuation indentation have been fixed. + - Add parameter -ipc, or --ignore-perlcritic-comments. Perltidy, by + default, will look for side comments beginning with ``## no critic`` and + ignore their lengths when making line break decisions, even if the user + has not set ``-iscl``. The reason is that an unwanted line break can + make these special comments ineffective in controlling ``perlcritic``. + The parameter -ipc can be set if, for some reason, this is not wanted. + + - Some minor issues with continuation indentation have been fixed. Most scripts will remain unchanged. The main change is that block comments which occur just before a closing brace, bracket or paren now have an indentation which is independent of the existance of an optional comma or semicolon. Previously, adding or deleting an optional trailing comma could cause their indentation to jump. Also, indentation of comments within ternary statements has been - improved. For additonal information see + improved. For additonal details see: https://github.com/perltidy/perltidy/blob/master/docs/ci_update.md + - This version was stress-tested for many cpu hours with random + input parameters. No failures to converge, internal fault checks, + undefined variable references or other irregularities were seen. + + - This version runs several percent faster than the previous release + on large files. + ## 2023 03 09 - No significant bugs have been found since the last release to CPAN. diff --git a/bin/perltidy b/bin/perltidy index dfdcdf4b..990c7e70 100755 --- a/bin/perltidy +++ b/bin/perltidy @@ -1272,8 +1272,8 @@ B then there would be no reason to set this flag. =item B<-xbtl=s>, B<--extended-block-tightness-list=s> -The previous parameter B<-xbt> can be made to apply curly braces preceded by -any of the keywords +The previous parameter B<-xbt> can be made to apply to curly braces preceded +by any of the keywords print printf exec system say @@ -5752,7 +5752,7 @@ The perltidy binary uses the Perl::Tidy module and is installed when that module =head1 VERSION -This man page documents perltidy version 20230309.04 +This man page documents perltidy version 20230701 =head1 BUG REPORTS @@ -5762,7 +5762,7 @@ To report a new bug or problem, use the "issues" link on this page. =head1 COPYRIGHT -Copyright (c) 2000-2022 by Steve Hancock +Copyright (c) 2000-2023 by Steve Hancock =head1 LICENSE diff --git a/docs/ChangeLog.html b/docs/ChangeLog.html index fbf590c5..8bc3f428 100644 --- a/docs/ChangeLog.html +++ b/docs/ChangeLog.html @@ -1,18 +1,11 @@

Perltidy Change Log

-

2023 03 09.04

+

2023 07 01

-
- Add parameter -ipc, or --ignore-perlcritic-comments.  Perltidy, by
-  default, will look for side comments beginning with ``## no critic`` and
-  ignore their lengths when making line break decisions, even if the user
-  has not set ``-iscl``.  The reason is that an unwanted line break can
-  make these special comments ineffective in controlling ``perlcritic``.
-  The parameter -ipc can be set if, for some reason, this is not wanted.
-
-- Issue git #121. Added parameters -xbt, or --extended-block-tightness,
+
- Issue git #121. Added parameters -xbt, or --extended-block-tightness,
   and -xbtl=s, or --extended-block-tightness-list=s, to allow
   certain small code blocks to have internal spacing controlled by
-  -bbt=n instead of -bt=n. The man pages have details.
+  -bbt=n rather than -bt=n. The man pages have details.
 
 - Issue git #118. A warning will be issued if a duplicate format-skipping
   starting marker is seen within a format-skipping section. The same
@@ -37,16 +30,30 @@
   --dump-block-summary on a file without any subs or other
   selected block types.
 
-- Some rare, minor issues with continuation indentation have been fixed.
+- Add parameter -ipc, or --ignore-perlcritic-comments.  Perltidy, by
+  default, will look for side comments beginning with ``## no critic`` and
+  ignore their lengths when making line break decisions, even if the user
+  has not set ``-iscl``.  The reason is that an unwanted line break can
+  make these special comments ineffective in controlling ``perlcritic``.
+  The parameter -ipc can be set if, for some reason, this is not wanted.
+
+- Some minor issues with continuation indentation have been fixed.
   Most scripts will remain unchanged.  The main change is that block
   comments which occur just before a closing brace, bracket or paren
   now have an indentation which is independent of the existance of
   an optional comma or semicolon.  Previously, adding or deleting
   an optional trailing comma could cause their indentation to jump.
   Also, indentation of comments within ternary statements has been
-  improved. For additonal information see
+  improved. For additonal details see:
 
   https://github.com/perltidy/perltidy/blob/master/docs/ci_update.md
+
+- This version was stress-tested for many cpu hours with random
+  input parameters. No failures to converge, internal fault checks,
+  undefined variable references or other irregularities were seen.
+
+- This version runs several percent faster than the previous release
+  on large files.
 

2023 03 09

diff --git a/docs/Tidy.html b/docs/Tidy.html index eee2389f..b13fbac0 100644 --- a/docs/Tidy.html +++ b/docs/Tidy.html @@ -399,7 +399,7 @@

VERSION

-

This man page documents Perl::Tidy version 20230309.04

+

This man page documents Perl::Tidy version 20230701

LICENSE

diff --git a/docs/ci_update.md b/docs/ci_update.md index bd3f5b72..565fa88a 100644 --- a/docs/ci_update.md +++ b/docs/ci_update.md @@ -1,9 +1,10 @@ # An update to the basic Perl::Tidy continuation indentation model -The next release after Perl::Tidy version 20230309 has several changes in the -basic method for computing "continuation indentation". The changes mainly -apply to some unusual situations, and most programs will remain unchanged. -This note explains what the changes are and why they are needed. +Perl::Tidy version 20230701 has several changes in the basic method for +computing "continuation indentation". This has been on the TODO list +for a long time. The changes mainly apply to some unusual situations, +and most programs will remain unchanged. This note explains what the changes +are and why they are needed. To briefly review, the indentation of a line is the sum of two parts: (1) **structural indentation**, and (2) **continuation indentation**. @@ -25,9 +26,9 @@ they are a continuation of the statement. The default continuation indentation is 2 characters but this can be changed with the **-ci=n** parameter. -The original continuation indentation programming in perltidy operated in the +Previously, computation of continuation indentation was done in the initial pass through a file, and this placed some limits on what it could do. -This update moves this coding downstream in the processing pipeline, where the +This computation has been moved downstream in the processing pipeline, where the entire file is accessible with full data structures, and this allows several improvements to be made. These mainly involve (1) the continuation indentation assigned to comments in unusual circumstances, or (2) the @@ -96,7 +97,7 @@ brace, and there are some comments before the closing ``if`` block brace. The previous logic had a limited look-ahead ability, and in this case the continuation indentation of the closing sub brace was not removed. -The updated logic handles this correctly: +The updated logic fixes this problem: ``` if ( $term->ReadLine eq "Term::ReadLine::Gnu" ) { @@ -113,8 +114,8 @@ The updated logic handles this correctly: ## Block comment indentation changes in ternary statements Another change is that the indentation of block comments within ternary -statements is improved. For example, here is the old default formatting of -a complex ternary with lots of comments: +statements is improved. These can be difficult to format. For example, +here is the old default formatting of a complex ternary with lots of comments: ``` # a) under an interactive shell? @@ -145,7 +146,7 @@ a complex ternary with lots of comments: : loc("suppressed in batch mode"); ``` -The comment indentation is very poor. Here is the new formatting: +The comment indentation is very poor here. Here is the new formatting: ``` # a) under an interactive shell? @@ -194,7 +195,8 @@ is_deeply $fixer->fix( { 'specific testing'; ``` -The closing '} )' is not indented correctly. The new default formatting is +The closing '} )' is missing some continuation indentation. The new default +formatting is ``` is_deeply $fixer->fix( { diff --git a/docs/perltidy.html b/docs/perltidy.html index eceba979..1f760629 100644 --- a/docs/perltidy.html +++ b/docs/perltidy.html @@ -956,7 +956,7 @@
-xbtl=s, --extended-block-tightness-list=s
-

The previous parameter -xbt can be made to apply curly braces preceded by any of the keywords

+

The previous parameter -xbt can be made to apply to curly braces preceded by any of the keywords

    print printf exec system say
@@ -4491,7 +4491,7 @@

VERSION

-

This man page documents perltidy version 20230309.04

+

This man page documents perltidy version 20230701

BUG REPORTS

@@ -4501,7 +4501,7 @@

COPYRIGHT

-

Copyright (c) 2000-2022 by Steve Hancock

+

Copyright (c) 2000-2023 by Steve Hancock

LICENSE

diff --git a/lib/Perl/Tidy.pm b/lib/Perl/Tidy.pm index a33a9f9f..94370ecc 100644 --- a/lib/Perl/Tidy.pm +++ b/lib/Perl/Tidy.pm @@ -114,7 +114,7 @@ BEGIN { # then the Release version must be bumped, and it is probably past time for # a release anyway. - $VERSION = '20230309.04'; + $VERSION = '20230701'; } ## end BEGIN sub DESTROY { diff --git a/lib/Perl/Tidy.pod b/lib/Perl/Tidy.pod index 0aa54cc1..7502a303 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 20230309.04 +This man page documents Perl::Tidy version 20230701 =head1 LICENSE diff --git a/lib/Perl/Tidy/Debugger.pm b/lib/Perl/Tidy/Debugger.pm index 4ba07988..5016e9bd 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 = '20230309.04'; +our $VERSION = '20230701'; use constant EMPTY_STRING => q{}; use constant SPACE => q{ }; diff --git a/lib/Perl/Tidy/DevNull.pm b/lib/Perl/Tidy/DevNull.pm index 469973ed..aa45d5f1 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 = '20230309.04'; +our $VERSION = '20230701'; 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 18c9679b..72fbf19f 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 = '20230309.04'; +our $VERSION = '20230701'; use constant EMPTY_STRING => q{}; diff --git a/lib/Perl/Tidy/FileWriter.pm b/lib/Perl/Tidy/FileWriter.pm index 34e5b2be..1a8c2f24 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 = '20230309.04'; +our $VERSION = '20230701'; use constant DEVEL_MODE => 0; use constant EMPTY_STRING => q{}; diff --git a/lib/Perl/Tidy/Formatter.pm b/lib/Perl/Tidy/Formatter.pm index e01a8422..ba5499a8 100644 --- a/lib/Perl/Tidy/Formatter.pm +++ b/lib/Perl/Tidy/Formatter.pm @@ -53,7 +53,7 @@ use constant SPACE => q{ }; use Carp; use English qw( -no_match_vars ); use List::Util qw( min max ); # min, max are in Perl 5.8 -our $VERSION = '20230309.04'; +our $VERSION = '20230701'; # The Tokenizer will be loaded with the Formatter ##use Perl::Tidy::Tokenizer; # for is_keyword() diff --git a/lib/Perl/Tidy/HtmlWriter.pm b/lib/Perl/Tidy/HtmlWriter.pm index 73060486..b3da89e6 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 = '20230309.04'; +our $VERSION = '20230701'; use English qw( -no_match_vars ); use File::Basename; diff --git a/lib/Perl/Tidy/IOScalar.pm b/lib/Perl/Tidy/IOScalar.pm index 149d0def..bbc71658 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 = '20230309.04'; +our $VERSION = '20230701'; use constant EMPTY_STRING => q{}; diff --git a/lib/Perl/Tidy/IOScalarArray.pm b/lib/Perl/Tidy/IOScalarArray.pm index 6e6257ae..e5e57005 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 = '20230309.04'; +our $VERSION = '20230701'; sub AUTOLOAD { diff --git a/lib/Perl/Tidy/IndentationItem.pm b/lib/Perl/Tidy/IndentationItem.pm index 42433de0..360bee5d 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 = '20230309.04'; +our $VERSION = '20230701'; BEGIN { diff --git a/lib/Perl/Tidy/LineBuffer.pm b/lib/Perl/Tidy/LineBuffer.pm index 7991b5fd..f1abd12d 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 = '20230309.04'; +our $VERSION = '20230701'; sub AUTOLOAD { diff --git a/lib/Perl/Tidy/LineSink.pm b/lib/Perl/Tidy/LineSink.pm index 1d75fece..1b2c2f2e 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 = '20230309.04'; +our $VERSION = '20230701'; sub AUTOLOAD { diff --git a/lib/Perl/Tidy/LineSource.pm b/lib/Perl/Tidy/LineSource.pm index e8b1a4c3..0c462480 100644 --- a/lib/Perl/Tidy/LineSource.pm +++ b/lib/Perl/Tidy/LineSource.pm @@ -9,7 +9,7 @@ package Perl::Tidy::LineSource; use strict; use warnings; use English qw( -no_match_vars ); -our $VERSION = '20230309.04'; +our $VERSION = '20230701'; use constant DEVEL_MODE => 0; diff --git a/lib/Perl/Tidy/Logger.pm b/lib/Perl/Tidy/Logger.pm index 1ac79cd4..5b25252c 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 = '20230309.04'; +our $VERSION = '20230701'; use English qw( -no_match_vars ); use constant DEVEL_MODE => 0; diff --git a/lib/Perl/Tidy/Tokenizer.pm b/lib/Perl/Tidy/Tokenizer.pm index 610b4ab0..d28e9328 100644 --- a/lib/Perl/Tidy/Tokenizer.pm +++ b/lib/Perl/Tidy/Tokenizer.pm @@ -23,7 +23,7 @@ use strict; use warnings; use English qw( -no_match_vars ); -our $VERSION = '20230309.04'; +our $VERSION = '20230701'; use Perl::Tidy::LineBuffer; use Carp; diff --git a/lib/Perl/Tidy/VerticalAligner.pm b/lib/Perl/Tidy/VerticalAligner.pm index e7da5a83..5b4ed5b6 100644 --- a/lib/Perl/Tidy/VerticalAligner.pm +++ b/lib/Perl/Tidy/VerticalAligner.pm @@ -3,7 +3,7 @@ use strict; use warnings; use Carp; use English qw( -no_match_vars ); -our $VERSION = '20230309.04'; +our $VERSION = '20230701'; use Perl::Tidy::VerticalAligner::Alignment; use Perl::Tidy::VerticalAligner::Line; diff --git a/lib/Perl/Tidy/VerticalAligner/Alignment.pm b/lib/Perl/Tidy/VerticalAligner/Alignment.pm index d14f0d8d..2e7af8ec 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 = '20230309.04'; +our $VERSION = '20230701'; sub new { my ( $class, $rarg ) = @_; diff --git a/lib/Perl/Tidy/VerticalAligner/Line.pm b/lib/Perl/Tidy/VerticalAligner/Line.pm index d6e5c70b..f595fc82 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; use English qw( -no_match_vars ); -our $VERSION = '20230309.04'; +our $VERSION = '20230701'; sub AUTOLOAD { diff --git a/local-docs/Release-Checklist.md b/local-docs/Release-Checklist.md index 863685c4..0de6c0d4 100644 --- a/local-docs/Release-Checklist.md +++ b/local-docs/Release-Checklist.md @@ -35,7 +35,7 @@ - note that I have tidyall set to also run perlcritic right now - run podchecker on all .pod files - run ispell on all .pod files -- Be sure builds at Travis.CI and Appveyor are clean for all version of perl +- Be sure builds at github and Appveyor are clean for all version of perl - update VERSION numbers in all modules and some docs (build.pl can do this): - lib/Perl/Tidy.pm - lib/Perl/Tidy.pod -- 2.39.5