From: Steve Hancock Date: Tue, 23 Nov 2021 19:26:35 +0000 (-0800) Subject: fix b1264, -lp formatting under stress X-Git-Tag: 20211029.02~7 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=2e44132d34862faf28497e072579735cb536bf09;p=perltidy.git fix b1264, -lp formatting under stress --- 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;