]> git.donarmstrong.com Git - perltidy.git/commitdiff
fix b1456
authorSteve Hancock <perltidy@users.sourceforge.net>
Mon, 26 Jun 2023 18:41:42 +0000 (11:41 -0700)
committerSteve Hancock <perltidy@users.sourceforge.net>
Mon, 26 Jun 2023 18:41:42 +0000 (11:41 -0700)
dev-bin/run_convergence_tests.pl.data
dev-bin/run_convergence_tests.pl.expect
lib/Perl/Tidy/Formatter.pm

index 74c8fea3544eecb64300fb7b7097c565f14406db..9e4b98c6a693e2eeb1034dda42528008129525ea 100644 (file)
@@ -11590,6 +11590,41 @@ if ($BOLD_MATH) {
 --space-function-paren
 --want-trailing-commas='b'
 
+==> b1456.in <==
+                    $resources->{$group_id} =
+                      {
+                         id => $group_id, ident => $group_ident,
+                         firstname   => $user->{firstname},
+                         lastname    => $user->{lastname},
+                         email       => $user->{email},
+                         timezone_id => $user->{timezone_id},
+                         name        => $user->{firstname} .
+                           " " .
+                           $user->{lastname}, selected => '0'
+                      };
+
+                    $resources->{$group_id} =
+                      {
+                         id => $group_id, ident => $group_ident,
+                         firstname   => $user->{firstname},
+                         lastname    => $user->{lastname},
+                         email       => $user->{email},
+                         timezone_id => $user->{timezone_id},
+                         name        => $user->{firstname} .
+                           " " . $user->{lastname}, selected => '0',
+                      };
+
+==> b1456.par <==
+--add-trailing-commas
+--break-after-all-operators
+--break-at-old-comma-breakpoints
+--delete-trailing-commas
+--indent-columns=5
+--keep-old-breakpoints-after='Z <<>> += : b = -- ] //= {'
+--maximum-line-length=71
+--short-concatenation-item-length=1
+--want-trailing-commas='h'
+
 ==> b146.in <==
 # State 1
 
index 231e3859663b0068a8eeb687ed01f2859879c460..68fb8f17ddf87e3f51578333affc6491061873a5 100644 (file)
@@ -7846,6 +7846,29 @@ if ($BOLD_MATH) {
     )
 }
 
+==> b1456 <==
+                    $resources->{$group_id} =
+                      {
+                         id => $group_id, ident => $group_ident,
+                         firstname   => $user->{firstname},
+                         lastname    => $user->{lastname},
+                         email       => $user->{email},
+                         timezone_id => $user->{timezone_id},
+                         name        => $user->{firstname} .
+                           " " . $user->{lastname}, selected => '0',
+                      };
+
+                    $resources->{$group_id} =
+                      {
+                         id => $group_id, ident => $group_ident,
+                         firstname   => $user->{firstname},
+                         lastname    => $user->{lastname},
+                         email       => $user->{email},
+                         timezone_id => $user->{timezone_id},
+                         name        => $user->{firstname} .
+                           " " . $user->{lastname}, selected => '0',
+                      };
+
 ==> b146 <==
 # State 1
 
@@ -7979,8 +8002,7 @@ Readonly::Array
        =>(
         q{$'},q{$$},
         q{$#},q{$:},
-       )
-       ;## no critic ( RequireInterpolationOfMetachars, ProhibitQuotedWordLists )
+       );## no critic ( RequireInterpolationOfMetachars, ProhibitQuotedWordLists )
 
 # State 2
 Readonly::Array
@@ -7988,8 +8010,7 @@ Readonly::Array
        =>(
         q{$'},q{$$},
         q{$#},q{$:},
-       )
-       ;## no critic ( RequireInterpolationOfMetachars, ProhibitQuotedWordLists )
+       );## no critic ( RequireInterpolationOfMetachars, ProhibitQuotedWordLists )
 
 
 ==> b183 <==
index 330cde9ce79b9b4f64f8d4f5e716da8a066a5feb..e8185647cbb74cef51153aec2bc43960593404dc 100644 (file)
@@ -9918,6 +9918,27 @@ sub match_trailing_comma_rule {
             {
                 $match = 1;
             }
+
+            # Patch for instability issue b1456: -boc can trick this test; so
+            # skip it when deleting commas to avoid possible instability
+            # with option 'h' in combination with -atc -dtc -boc;
+            elsif (
+                $trailing_comma_style eq 'h'
+
+                # this is a deletion (due to -dtc)
+                && !$if_add
+
+                # -atc is also set
+                && $rOpts_add_trailing_commas
+
+                # -boc is set and active
+                && $rOpts_break_at_old_comma_breakpoints
+                && !$rOpts_ignore_old_breakpoints
+              )
+            {
+                # ignore this test
+            }
+
             else {
                 return;
             }