From 141099880b17b57158a633ca8e551873db1d7a2c Mon Sep 17 00:00:00 2001 From: Steve Hancock Date: Fri, 27 Sep 2024 06:30:19 -0700 Subject: [PATCH] revise fix for b1455 --- dev-bin/run_convergence_tests.pl.expect | 24 ++++++++++++++---------- lib/Perl/Tidy/Formatter.pm | 19 ++++++++++++------- lib/Perl/Tidy/VerticalAligner.pm | 5 +---- 3 files changed, 27 insertions(+), 21 deletions(-) diff --git a/dev-bin/run_convergence_tests.pl.expect b/dev-bin/run_convergence_tests.pl.expect index 1986d7a7..e305c91d 100644 --- a/dev-bin/run_convergence_tests.pl.expect +++ b/dev-bin/run_convergence_tests.pl.expect @@ -7043,8 +7043,8 @@ if ( ioctl ( STDERR, $TIOCGWINSZ, ...; } -if ( ioctl ( STDERR, $TIOCGWINSZ, - $winsize ) +if ( ioctl ( STDERR, $TIOCGWINSZ, $winsize + ) ) { ...; @@ -7103,24 +7103,28 @@ SOAP::Transport::HTTP::Daemon->new (LocalAddr => $host, ==> b1396 <== print 'not ' - unless ( near ( great_circle_distance ( 0, 0, 0, pi / 2 ), - pi / 2 ) ); + unless ( near ( + great_circle_distance ( 0, 0, 0, pi / 2 ), pi / 2 + ) ); print 'not ' - unless ( near ( great_circle_distance ( 0, 0, 0, pi / 2 ), - pi / 2 ) ); + unless ( near ( + great_circle_distance ( 0, 0, 0, pi / 2 ), pi / 2 + ) ); ==> b1397 <== ( - my $msg = sprintf ( gettext("%s: fatal error at line %d:\n"), - $progname, $line ) + my $msg = sprintf ( + gettext("%s: fatal error at line %d:\n"), $progname, $line + ) . "@_\n" ) =~ tr/\0//d; ( - my $msg = sprintf ( gettext("%s: fatal error at line %d:\n"), - $progname, $line ) + my $msg = sprintf ( + gettext("%s: fatal error at line %d:\n"), $progname, $line + ) . "@_\n" ) =~ tr/\0//d; diff --git a/lib/Perl/Tidy/Formatter.pm b/lib/Perl/Tidy/Formatter.pm index 724ec313..9dc5a79d 100644 --- a/lib/Perl/Tidy/Formatter.pm +++ b/lib/Perl/Tidy/Formatter.pm @@ -18003,8 +18003,8 @@ sub initialize_warn_mismatched { # y - want scalar but no return seen # s - want scalar but only arrays with count > 1 returned $rwarn_mismatched_return_types = - initialize_warn_hash( 'warn-mismatched-return-types', - 1, [qw(x o u y s)] ); + initialize_warn_hash( 'warn-mismatched-return-types', 1, + [qw(x o u y s)] ); $ris_warn_mismatched_return_excluded_name = make_excluded_name_hash('warn-mismatched-return-exclusion-list'); return; @@ -19356,10 +19356,7 @@ EOM $weld_count_this_start = 0; $weld_starts_in_block = 0; - ( - my $new_weld_ok, - $maximum_text_length, $starting_lentot, my $msg - ) + ( my $new_weld_ok, $maximum_text_length, $starting_lentot, my $msg ) = $self->setup_new_weld_measurements( $Kouter_opening, $Kinner_opening ); @@ -31947,7 +31944,15 @@ EOM # Increase tol when -atc and -dtc are both used to allow for # possible loss in length on next pass due to a comma. Fixes b1455. - if ( $rOpts_delete_trailing_commas && $rOpts_add_trailing_commas ) { + if ( + $rOpts_delete_trailing_commas + && $rOpts_add_trailing_commas + + # optional additional restriction which works for b1455: + && $rOpts_extended_continuation_indentation + && $rOpts_continuation_indentation > $rOpts_indent_columns + ) + { $tol += 1; } diff --git a/lib/Perl/Tidy/VerticalAligner.pm b/lib/Perl/Tidy/VerticalAligner.pm index e58aa346..c4890852 100644 --- a/lib/Perl/Tidy/VerticalAligner.pm +++ b/lib/Perl/Tidy/VerticalAligner.pm @@ -2904,10 +2904,7 @@ EOM #---------------------------------------------------- # Create a hash of alignment token info for each line #---------------------------------------------------- - ( - my $rline_hashes, my $requals_info, - $saw_side_comment, $max_lev_diff - ) + ( my $rline_hashes, my $requals_info, $saw_side_comment, $max_lev_diff ) = make_alignment_info( $group_level, $rnew_lines, $saw_side_comment ); #------------------------------------------------------------ -- 2.39.5