From b6007df9addec29bb1a3f78e24ad68e54e446862 Mon Sep 17 00:00:00 2001 From: Steve Hancock Date: Fri, 2 Dec 2022 17:53:40 -0800 Subject: [PATCH] bump version to 20221112.01 --- CHANGES.md | 5 +++++ bin/perltidy | 2 +- lib/Perl/Tidy.pm | 14 +++++++++++++- 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 | 15 +++++---------- 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 +- 21 files changed, 41 insertions(+), 29 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 55cf8e3b..70ba95e3 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,5 +1,10 @@ # Perltidy Change Log +## 2022 11 12.01 + + - Added option -dbs, or --dump-block-summary, to dump summary + information about code blocks in a file to standard output. + ## 2022 11 12 - Fix rt #145095, undef warning in Perl before 5.12. Version 20221112 is diff --git a/bin/perltidy b/bin/perltidy index a9239bfb..f5870e2c 100755 --- a/bin/perltidy +++ b/bin/perltidy @@ -5427,7 +5427,7 @@ The perltidy binary uses the Perl::Tidy module and is installed when that module =head1 VERSION -This man page documents perltidy version 20221112 +This man page documents perltidy version 20221112.01 =head1 BUG REPORTS diff --git a/lib/Perl/Tidy.pm b/lib/Perl/Tidy.pm index 0b2a3783..83315cf6 100644 --- a/lib/Perl/Tidy.pm +++ b/lib/Perl/Tidy.pm @@ -113,7 +113,7 @@ BEGIN { # then the Release version must be bumped, and it is probably past time for # a release anyway. - $VERSION = '20221112'; + $VERSION = '20221112.01'; } sub DESTROY { @@ -844,6 +844,17 @@ EOM Exit(0); } + # --dump-block-summary requires one filename in the arg list. + # This is a safety precaution in case a user accidentally adds -dbs to the + # command line parameters and is expecting formatted output to stdout. + # Another precaution, added elsewhere, is to ignore -dbs in a .perltidyrc + my $numf = @Arg_files; + if ( $rOpts->{'dump-block-summary'} && $numf != 1 ) { + Die(< q{}; use constant SPACE => q{ }; diff --git a/lib/Perl/Tidy/DevNull.pm b/lib/Perl/Tidy/DevNull.pm index 4716271d..0c73f7a4 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 = '20221112'; +our $VERSION = '20221112.01'; 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 a111ce8f..0d19e9b8 100644 --- a/lib/Perl/Tidy/Diagnostics.pm +++ b/lib/Perl/Tidy/Diagnostics.pm @@ -21,7 +21,7 @@ package Perl::Tidy::Diagnostics; use strict; use warnings; use English qw( -no_match_vars ); -our $VERSION = '20221112'; +our $VERSION = '20221112.01'; use constant EMPTY_STRING => q{}; diff --git a/lib/Perl/Tidy/FileWriter.pm b/lib/Perl/Tidy/FileWriter.pm index 8dd5c115..b5ffe822 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 = '20221112'; +our $VERSION = '20221112.01'; 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 e05f681c..6148a48c 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 = '20221112'; +our $VERSION = '20221112.01'; # The Tokenizer will be loaded with the Formatter ##use Perl::Tidy::Tokenizer; # for is_keyword() @@ -6093,7 +6093,7 @@ sub dump_block_summary { foreach my $seqno ( keys %{$rblock_type_of_seqno} ) { my $type; - my $name = ""; + my $name = EMPTY_STRING; my $block_type = $rblock_type_of_seqno->{$seqno}; my $K_opening = $K_opening_container->{$seqno}; my $K_closing = $K_closing_container->{$seqno}; @@ -6200,9 +6200,11 @@ EOM } #--------------------------- - # Dump the results to STDOUt + # Dump the results to STDOUT #--------------------------- + return unless %{$rselected_blocks}; + my $routput_lines; push @{$routput_lines}, "file,line,type,name,line_count,level_start,level_diff,total_variation\n"; @@ -6220,13 +6222,6 @@ EOM push @{$routput_lines}, $line; } - push @{$routput_lines}, < q{}; diff --git a/lib/Perl/Tidy/IOScalarArray.pm b/lib/Perl/Tidy/IOScalarArray.pm index f110fd70..16bded98 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 = '20221112'; +our $VERSION = '20221112.01'; sub AUTOLOAD { diff --git a/lib/Perl/Tidy/IndentationItem.pm b/lib/Perl/Tidy/IndentationItem.pm index 2ccd8a1b..4b8b9851 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 = '20221112'; +our $VERSION = '20221112.01'; BEGIN { diff --git a/lib/Perl/Tidy/LineBuffer.pm b/lib/Perl/Tidy/LineBuffer.pm index a59f9927..a379578a 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 = '20221112'; +our $VERSION = '20221112.01'; sub AUTOLOAD { diff --git a/lib/Perl/Tidy/LineSink.pm b/lib/Perl/Tidy/LineSink.pm index 111d75b4..a7fd0018 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 = '20221112'; +our $VERSION = '20221112.01'; sub AUTOLOAD { diff --git a/lib/Perl/Tidy/LineSource.pm b/lib/Perl/Tidy/LineSource.pm index 389020d1..d5f4b3a8 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 = '20221112'; +our $VERSION = '20221112.01'; use constant DEVEL_MODE => 0; diff --git a/lib/Perl/Tidy/Logger.pm b/lib/Perl/Tidy/Logger.pm index a47a9eb4..2186818c 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 = '20221112'; +our $VERSION = '20221112.01'; 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 a2cb76fa..9e88c5c5 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 = '20221112'; +our $VERSION = '20221112.01'; use Perl::Tidy::LineBuffer; use Carp; diff --git a/lib/Perl/Tidy/VerticalAligner.pm b/lib/Perl/Tidy/VerticalAligner.pm index 5704a90c..ee3b4b5c 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 = '20221112'; +our $VERSION = '20221112.01'; 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 209b2e50..3f6cd8a7 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 = '20221112'; +our $VERSION = '20221112.01'; sub new { my ( $class, $rarg ) = @_; diff --git a/lib/Perl/Tidy/VerticalAligner/Line.pm b/lib/Perl/Tidy/VerticalAligner/Line.pm index 75fa3ac3..83805006 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 = '20221112'; +our $VERSION = '20221112.01'; sub AUTOLOAD { -- 2.39.5