]> git.donarmstrong.com Git - perltidy.git/commitdiff
fix issue c302
authorSteve Hancock <perltidy@users.sourceforge.net>
Sun, 5 Nov 2023 22:29:51 +0000 (14:29 -0800)
committerSteve Hancock <perltidy@users.sourceforge.net>
Sun, 5 Nov 2023 22:29:51 +0000 (14:29 -0800)
dev-bin/run_convergence_tests.pl.data
dev-bin/run_convergence_tests.pl.expect
lib/Perl/Tidy/Formatter.pm

index cf67113484ae0e04bda40afc3a92f24cb1eb3b70..2b3d7b9d3d7763a733ec0092246ef2fb7e92c95e 100644 (file)
@@ -18387,3 +18387,26 @@ s/^([^\t]*)(\t+)/$1.(" " x ((length($2)<<3)-(length($1)&7)))/e )
 
 ==> c190.par <==
 -pbp -nst -nse -wn -xci -conv -fso -gcs -maxue=3
+
+==> c302.in <==
+use strict;
+use warnings;
+
+use Params::Validate qw(:all);
+
+use PVTests;
+use Test::More 0.88;
+my $String = 'foo';    # blank after this opens and closes
+
+my $Foo  = bless \$v1, 'Foo';
+my $Bar  = bless \$v2, 'Bar';
+my $Baz  = bless \$v3, 'Baz';
+my $Quux = bless \$v4, 'Quux';
+my $v1;
+my ( $v1, $v2, $v3, $v4 );
+
+
+==> c302.par <==
+--keyword-group-blanks-after=2
+--keyword-group-blanks-before=0
+--keyword-group-blanks-size='1.8'
index ec324363d927a2a9c6db13ae7936e75133f61caa..03dd2581f08c6dcc6c5ca700c68b26ea23e83bd7 100644 (file)
@@ -11386,3 +11386,21 @@ s/^([^\t]*)(\t+)/$1.(" " x ((length($2)<<3)-(length($1)&7)))/e )
             . '(&make_deferred_wrapper(1).$cmd.'
             . "\"$padding\""
             . '.$args.&make_deferred_wrapper(0),$_)}' . "\n";
+
+==> c302 <==
+use strict;
+use warnings;
+
+use Params::Validate qw(:all);
+
+use PVTests;
+use Test::More 0.88;
+my $String = 'foo';    # blank after this opens and closes
+
+my $Foo  = bless \$v1, 'Foo';
+my $Bar  = bless \$v2, 'Bar';
+my $Baz  = bless \$v3, 'Baz';
+my $Quux = bless \$v4, 'Quux';
+my $v1;
+my ( $v1, $v2, $v3, $v4 );
+
index 18d4372827660dad473f1f3626096debd5313b06..4af869e893b9be4a5b4c7b9993fe403332e98439 100644 (file)
@@ -15681,6 +15681,15 @@ EOM
 
         return $rhash_of_desires if ( !$ok );
 
+        # The following parameter combination can be unstable (c302):
+        if (   $rOpts_kgb_size_max
+            && $rOpts_kgb_after == INSERT
+            && $rOpts_kgb_before == DELETE )
+        {
+            # We reset kgb_before=STABLE to fix and continue
+            $rOpts_kgb_before = STABLE;
+        }
+
         return;
     } ## end sub kgb_initialize_options