From 4889c878404b530492346ecdd1dd8d5590a0764a Mon Sep 17 00:00:00 2001 From: Steve Hancock Date: Mon, 1 Jan 2024 17:43:13 -0800 Subject: [PATCH] fix issue where -nwcp without -wcp was not working --- lib/Perl/Tidy/Formatter.pm | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/lib/Perl/Tidy/Formatter.pm b/lib/Perl/Tidy/Formatter.pm index 7376d851..a16edb6f 100644 --- a/lib/Perl/Tidy/Formatter.pm +++ b/lib/Perl/Tidy/Formatter.pm @@ -9791,24 +9791,24 @@ sub dump_mixed_call_parens { my ( $no_count, $yes_count, $type ) = @{ $call_counts{$key} }; next unless ( $no_count && $yes_count ); - # display type 'U' as 's' on output for clarity and better sorted order - my $type_out = $type eq 'U' ? 's' : $type; push @mixed_counts, { name => $key, - type => $type_out, + type => $type, no_count => $no_count, yes_count => $yes_count }; } return unless (@mixed_counts); + + # sort on lc of type so that user sub type 'U' will come after 'k' my @sorted = - sort { $a->{type} cmp $b->{type} || $a->{name} cmp $b->{name} } + sort { lc $a->{type} cmp lc $b->{type} || $a->{name} cmp $b->{name} } @mixed_counts; my $output_string = <{$opt_name}; - return unless ($rOpts_warn_call_parens); + return unless (%call_paren_style); + my $opt_name = 'want-call-parens'; # Types which will be checked: # 'k'=builtin keyword, 'U'=user defined sub, 'w'=unknown bareword my %is_kwU = ( 'k' => 1, 'w' => 1, 'U' => 1 ); - # if no hash, user may have just entered -wcp='!' - return unless (%call_paren_style); - my $rwarnings = []; #--------------------- -- 2.39.5