]> git.donarmstrong.com Git - perltidy.git/commitdiff
fix b1430
authorSteve Hancock <perltidy@users.sourceforge.net>
Tue, 22 Nov 2022 22:32:37 +0000 (14:32 -0800)
committerSteve Hancock <perltidy@users.sourceforge.net>
Tue, 22 Nov 2022 22:32:37 +0000 (14:32 -0800)
dev-bin/run_convergence_tests.pl.data
lib/Perl/Tidy/Formatter.pm

index 6ef88fd6b0f68a670f3576415a418c33d645550a..c5b5a1714dd9cddc56e0202208f429fc603eb7f9 100644 (file)
@@ -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->{
index eabc70ebe0622253ff75549da59105ed91203a6f..ad9352511a37896c4e3575a2cd93c3d8d1042631 100644 (file)
@@ -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)