# 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
=head1 VERSION
-This man page documents perltidy version 20221112
+This man page documents perltidy version 20221112.01
=head1 BUG REPORTS
# then the Release version must be bumped, and it is probably past time for
# a release anyway.
- $VERSION = '20221112';
+ $VERSION = '20221112.01';
}
sub DESTROY {
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(<<EOM);
+--dump-block-summary expects 1 filename in the arg list but saw $numf filenames
+EOM
+ }
+
#----------------------------------------
# check parameters and their interactions
#----------------------------------------
dump-token-types
dump-want-left-space
dump-want-right-space
+ dump-block-summary
help
stylesheet
version
=head1 VERSION
-This man page documents Perl::Tidy version 20221112
+This man page documents Perl::Tidy version 20221112.01
=head1 LICENSE
use strict;
use warnings;
use English qw( -no_match_vars );
-our $VERSION = '20221112';
+our $VERSION = '20221112.01';
use constant EMPTY_STRING => q{};
use constant SPACE => q{ };
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 }
use strict;
use warnings;
use English qw( -no_match_vars );
-our $VERSION = '20221112';
+our $VERSION = '20221112.01';
use constant EMPTY_STRING => q{};
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{};
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()
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};
}
#---------------------------
- # 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";
push @{$routput_lines}, $line;
}
- push @{$routput_lines}, <<EOM;
-
-'Made with --dump-block-summary (or -dbs) with settings:
-'--dump-block-minimum-lines=$rOpts_dump_block_minimum_lines (or -dbml=$rOpts_dump_block_minimum_lines)
-'--dump-block-types=$rOpts_dump_block_types (or -dbt=$rOpts_dump_block_types)
-EOM
-
foreach my $line ( @{$routput_lines} ) {
print STDOUT $line;
}
package Perl::Tidy::HtmlWriter;
use strict;
use warnings;
-our $VERSION = '20221112';
+our $VERSION = '20221112.01';
use English qw( -no_match_vars );
use File::Basename;
use strict;
use warnings;
use Carp;
-our $VERSION = '20221112';
+our $VERSION = '20221112.01';
use constant EMPTY_STRING => q{};
use strict;
use warnings;
use Carp;
-our $VERSION = '20221112';
+our $VERSION = '20221112.01';
sub AUTOLOAD {
package Perl::Tidy::IndentationItem;
use strict;
use warnings;
-our $VERSION = '20221112';
+our $VERSION = '20221112.01';
BEGIN {
package Perl::Tidy::LineBuffer;
use strict;
use warnings;
-our $VERSION = '20221112';
+our $VERSION = '20221112.01';
sub AUTOLOAD {
package Perl::Tidy::LineSink;
use strict;
use warnings;
-our $VERSION = '20221112';
+our $VERSION = '20221112.01';
sub AUTOLOAD {
use strict;
use warnings;
use English qw( -no_match_vars );
-our $VERSION = '20221112';
+our $VERSION = '20221112.01';
use constant DEVEL_MODE => 0;
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;
use warnings;
use English qw( -no_match_vars );
-our $VERSION = '20221112';
+our $VERSION = '20221112.01';
use Perl::Tidy::LineBuffer;
use Carp;
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;
{ #<<< A non-indenting brace
-our $VERSION = '20221112';
+our $VERSION = '20221112.01';
sub new {
my ( $class, $rarg ) = @_;
use strict;
use warnings;
use English qw( -no_match_vars );
-our $VERSION = '20221112';
+our $VERSION = '20221112.01';
sub AUTOLOAD {