From a47cb7a62f6b5f010452c99cb7fe4e8871f93091 Mon Sep 17 00:00:00 2001 From: Steve Hancock Date: Thu, 20 Oct 2022 17:53:25 -0700 Subject: [PATCH] fix instability b1395 --- dev-bin/run_convergence_tests.pl.data | 24 ++++++++++++++++++++++++ lib/Perl/Tidy/Formatter.pm | 14 ++++++++++---- 2 files changed, 34 insertions(+), 4 deletions(-) diff --git a/dev-bin/run_convergence_tests.pl.data b/dev-bin/run_convergence_tests.pl.data index 6602117c..01e08941 100644 --- a/dev-bin/run_convergence_tests.pl.data +++ b/dev-bin/run_convergence_tests.pl.data @@ -10454,6 +10454,30 @@ SOAP::Transport::HTTP::Daemon->new (LocalAddr => $host, --extended-line-up-parentheses --want-trailing-commas='h' +==> b1395.in <== + # The old = break is under stress and must be ignored + if(my ($safari_build, $safari_minor) = + split /\./, $1) + { + ...; + } + + if( + my ($safari_build, $safari_minor) + = split /\./, $1 + ) + { + ...; + } + + +==> b1395.par <== +--continuation-indentation=5 +--indent-columns=6 +--maximum-line-length=57 +--nospace-after-keyword='if' +--paren-tightness=2 + ==> b140.in <== $cmd[ $i ]=[ $s, $e, $cmd, \@hunk, $i ] ; diff --git a/lib/Perl/Tidy/Formatter.pm b/lib/Perl/Tidy/Formatter.pm index 3fd0f2a4..12e000b1 100644 --- a/lib/Perl/Tidy/Formatter.pm +++ b/lib/Perl/Tidy/Formatter.pm @@ -20206,11 +20206,17 @@ EOM $last_old_breakpoint_count = $old_breakpoint_count; # Check for a good old breakpoint .. - # Note: ignore old breaks at types 'L' and 'R' to fix case - # b1097. These breaks only occur under high stress. - if ( $old_breakpoint_to_go[$i] + if ( + $old_breakpoint_to_go[$i] + + # Note: ignore old breaks at types 'L' and 'R' to fix case + # b1097. These breaks only occur under high stress. && $type ne 'L' - && $next_nonblank_type ne 'R' ) + && $next_nonblank_type ne 'R' + + # ... and ignore other high stress level breaks, fixes b1395 + && $levels_to_go[$i] < $list_stress_level + ) { ( $want_previous_breakpoint, $i_old_assignment_break ) = $self->check_old_breakpoints( $i_next_nonblank, -- 2.39.5