# 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
--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.
=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
=head1 VERSION
-This man page documents perltidy version 20230309.04
+This man page documents perltidy version 20230701
=head1 BUG REPORTS
=head1 COPYRIGHT
-Copyright (c) 2000-2022 by Steve Hancock
+Copyright (c) 2000-2023 by Steve Hancock
=head1 LICENSE
<h1>Perltidy Change Log</h1>
-<h2>2023 03 09.04</h2>
+<h2>2023 07 01</h2>
-<pre><code>- 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,
+<pre><code>- 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
--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.
</code></pre>
<h2>2023 03 09</h2>
<h1 id="VERSION">VERSION</h1>
-<p>This man page documents Perl::Tidy version 20230309.04</p>
+<p>This man page documents Perl::Tidy version 20230701</p>
<h1 id="LICENSE">LICENSE</h1>
# 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**.
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
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" ) {
## 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?
: 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?
'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( {
<dt id="xbtl-s---extended-block-tightness-list-s"><b>-xbtl=s</b>, <b>--extended-block-tightness-list=s</b></dt>
<dd>
-<p>The previous parameter <b>-xbt</b> can be made to apply curly braces preceded by any of the keywords</p>
+<p>The previous parameter <b>-xbt</b> can be made to apply to curly braces preceded by any of the keywords</p>
<pre><code> print printf exec system say</code></pre>
<h1 id="VERSION">VERSION</h1>
-<p>This man page documents perltidy version 20230309.04</p>
+<p>This man page documents perltidy version 20230701</p>
<h1 id="BUG-REPORTS">BUG REPORTS</h1>
<h1 id="COPYRIGHT">COPYRIGHT</h1>
-<p>Copyright (c) 2000-2022 by Steve Hancock</p>
+<p>Copyright (c) 2000-2023 by Steve Hancock</p>
<h1 id="LICENSE">LICENSE</h1>
# 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 {
=head1 VERSION
-This man page documents Perl::Tidy version 20230309.04
+This man page documents Perl::Tidy version 20230701
=head1 LICENSE
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{ };
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 }
use strict;
use warnings;
use English qw( -no_match_vars );
-our $VERSION = '20230309.04';
+our $VERSION = '20230701';
use constant EMPTY_STRING => q{};
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{};
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()
package Perl::Tidy::HtmlWriter;
use strict;
use warnings;
-our $VERSION = '20230309.04';
+our $VERSION = '20230701';
use English qw( -no_match_vars );
use File::Basename;
use strict;
use warnings;
use Carp;
-our $VERSION = '20230309.04';
+our $VERSION = '20230701';
use constant EMPTY_STRING => q{};
use strict;
use warnings;
use Carp;
-our $VERSION = '20230309.04';
+our $VERSION = '20230701';
sub AUTOLOAD {
package Perl::Tidy::IndentationItem;
use strict;
use warnings;
-our $VERSION = '20230309.04';
+our $VERSION = '20230701';
BEGIN {
package Perl::Tidy::LineBuffer;
use strict;
use warnings;
-our $VERSION = '20230309.04';
+our $VERSION = '20230701';
sub AUTOLOAD {
package Perl::Tidy::LineSink;
use strict;
use warnings;
-our $VERSION = '20230309.04';
+our $VERSION = '20230701';
sub AUTOLOAD {
use strict;
use warnings;
use English qw( -no_match_vars );
-our $VERSION = '20230309.04';
+our $VERSION = '20230701';
use constant DEVEL_MODE => 0;
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;
use warnings;
use English qw( -no_match_vars );
-our $VERSION = '20230309.04';
+our $VERSION = '20230701';
use Perl::Tidy::LineBuffer;
use Carp;
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;
{ #<<< A non-indenting brace
-our $VERSION = '20230309.04';
+our $VERSION = '20230701';
sub new {
my ( $class, $rarg ) = @_;
use strict;
use warnings;
use English qw( -no_match_vars );
-our $VERSION = '20230309.04';
+our $VERSION = '20230701';
sub AUTOLOAD {
- 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