From 9b729775c9bec3fd266ff4199bf22df8bd99a23a Mon Sep 17 00:00:00 2001 From: Steve Hancock Date: Tue, 22 Nov 2022 14:32:37 -0800 Subject: [PATCH] fix b1430 --- dev-bin/run_convergence_tests.pl.data | 24 ++++++++++++++++++++++++ lib/Perl/Tidy/Formatter.pm | 17 ++++++++++++++++- 2 files changed, 40 insertions(+), 1 deletion(-) diff --git a/dev-bin/run_convergence_tests.pl.data b/dev-bin/run_convergence_tests.pl.data index 6ef88fd6..c5b5a171 100644 --- a/dev-bin/run_convergence_tests.pl.data +++ b/dev-bin/run_convergence_tests.pl.data @@ -10988,6 +10988,30 @@ my$sem=sub --variable-maximum-line-length --want-trailing-commas='m' +==> b1430.in <== + $t->post_ok( + "//$auth_userid:$password@/api/v1/advanced_editor/macros" => + json => $macro_values )->status_is(400)->json_is( + '/errors' => [ { + message => "Read-only.", + path => "/body/macro_id", + } ] + ); + + $t->post_ok( + "//$auth_userid:$password@/api/v1/advanced_editor/macros" => + json => $macro_values )->status_is(400) + ->json_is( '/errors' => + [ { message => "Read-only.", path => "/body/macro_id", } ] ); + + +==> b1430.par <== +--continuation-indentation=8 +--ignore-old-breakpoints +--indent-columns=9 +--weld-fat-comma +--weld-nested-containers + ==> b1431.in <== C4::Circulation::AddRenewal( $issue->{ diff --git a/lib/Perl/Tidy/Formatter.pm b/lib/Perl/Tidy/Formatter.pm index eabc70eb..ad935251 100644 --- a/lib/Perl/Tidy/Formatter.pm +++ b/lib/Perl/Tidy/Formatter.pm @@ -10420,6 +10420,21 @@ EOM $rK_weld_right->{$Kinner_closing} = $Kouter_closing; $rK_weld_left->{$Kouter_closing} = $Kinner_closing; + + # Keep a broken container broken at multiple welds. This might + # also be useful for simple welds, but for now it is restricted + # to multiple welds to minimize changes to existing coding. This + # fixes b1429, b1430. + if ( $iline_io != $iline_ic ) { + + # Only set this break if it is the last possible weld in this + # chain. This will keep some extreme test cases unchanged. + my $is_chain_end = !@{$rnested_pairs} + || $rnested_pairs->[-1]->[1] != $inner_seqno; + if ($is_chain_end) { + $self->[_rwant_container_open_]->{$inner_seqno} = 1; + } + } } # After welding, reduce the indentation level if all intermediate tokens @@ -12105,7 +12120,7 @@ sub xlp_collapsed_lengths { # # Help::WorkSubmitter->_filter_chores_and_maybe_warn_user( # $story_set_all_chores), - # or this (b1438): + # or this (b1431): # $issue->{ # 'borrowernumber'}, # borrowernumber if ( defined($Kc_test) -- 2.39.5