From 2e44132d34862faf28497e072579735cb536bf09 Mon Sep 17 00:00:00 2001 From: Steve Hancock Date: Tue, 23 Nov 2021 11:26:35 -0800 Subject: [PATCH] fix b1264, -lp formatting under stress --- dev-bin/run_convergence_tests.pl.data | 27 +++++++++++++++++++++++++++ lib/Perl/Tidy/Formatter.pm | 7 ++++++- 2 files changed, 33 insertions(+), 1 deletion(-) diff --git a/dev-bin/run_convergence_tests.pl.data b/dev-bin/run_convergence_tests.pl.data index 6b88387d..2225dc7e 100644 --- a/dev-bin/run_convergence_tests.pl.data +++ b/dev-bin/run_convergence_tests.pl.data @@ -8375,6 +8375,33 @@ printf --opening-paren-right --variable-maximum-line-length +==> b1264.in <== +#S1 +function( + 'objectclass'=>['top','person', + 'organizationalPerson','inetOrgperson'], +); +# S2 +function( + 'objectclass'=>['top','person', + 'organizationalPerson', + 'inetOrgperson'], +); +# S3 +function( + 'objectclass'=> + ['top','person','organizationalPerson', + 'inetOrgperson'], +); + +==> b1264.par <== +--noadd-whitespace +--break-before-square-bracket=1 +--line-up-parentheses +--indent-columns=10 +--maximum-line-length=41 +--variable-maximum-line-length + ==> b131.in <== unless ( open( SCORE, "+>>$Score_File" ) ) diff --git a/lib/Perl/Tidy/Formatter.pm b/lib/Perl/Tidy/Formatter.pm index 23849309..7a3dea98 100644 --- a/lib/Perl/Tidy/Formatter.pm +++ b/lib/Perl/Tidy/Formatter.pm @@ -17710,8 +17710,13 @@ EOM # Ignore old breakpoints when under stress. # Fixes b1203 b1204 as well as b1197-b1200. + # But not if -lp: fixes b1264, b1265. NOTE: rechecked with + # b1264 to see if this check is still required at all, and + # these still require a check, but at higher level beta+3 + # instead of beta: b1193 b780 if ( $saw_opening_structure - && $levels_to_go[$i_opening] >= $stress_level_beta ) + && !$is_lp_container + && $levels_to_go[$i_opening] >= $stress_level_beta + 3 ) { $cab_flag = 2; -- 2.39.5