]> git.donarmstrong.com Git - perltidy.git/commitdiff
fix issue b1219
authorSteve Hancock <perltidy@users.sourceforge.net>
Tue, 5 Oct 2021 14:26:47 +0000 (07:26 -0700)
committerSteve Hancock <perltidy@users.sourceforge.net>
Tue, 5 Oct 2021 14:26:47 +0000 (07:26 -0700)
dev-bin/run_convergence_tests.pl.data
lib/Perl/Tidy/Formatter.pm
lib/Perl/Tidy/Tokenizer.pm

index 06a9c8898643a082dc15263a5512899eba4a7a02..84ba8128b877a96327c2814015996ecf492d5b58 100644 (file)
@@ -7530,6 +7530,32 @@ is( Koha::Acquisition::Funds->search->count,
 --maximum-line-length=50
 --variable-maximum-line-length
 
+==> b1219.in <==
+# S1
+subtest 'check_password hook tests'=>sub{
+             ok( $patron->set_password({password=>'explosion',skip_validation=>1} ),
+                 'Patron password updated via skip validation' );
+};
+
+#S2
+subtest 'check_password hook tests'=>sub{
+             ok(
+                 $patron->set_password({password=>'explosion',skip_validation=>1} ),
+                 'Patron password updated via skip validation' );
+};
+
+==> b1219.par <==
+--noadd-whitespace
+--continuation-indentation=4
+--delete-old-whitespace
+--extended-continuation-indentation
+--indent-columns=9
+--line-up-parentheses
+--maximum-line-length=84
+--vertical-tightness-closing=2
+--vertical-tightness=1
+--weld-nested-containers
+
 ==> b1220.in <==
 # S1
 print$msg,
index 8c839601b47e703a40314213c3600511a251e7bc..7a15d31192cf6ab5fb1bc725ed7458a25dc64ce7 100644 (file)
@@ -8386,53 +8386,15 @@ EOM
 
             # An existing one-line weld is a line in which
             # (1) the containers are all on one line, and
-            # (2) the line does not exceed the allowable length, and
-            # (3) is not created with -lp -vt=n instead of welding
-            # This flag is used to avoid creating blinkers.
-            # FIX1: Changed 'excess_length_to_K' to 'excess_length_of_line'
-            # to get exact lengths and fix b604 b605.
+            # (2) the line does not exceed the allowable length
             if ( $iline_oo == $iline_oc ) {
 
                 # All the tokens are on one line, now check their length
                 my $excess =
                   $self->excess_line_length_for_Krange( $Kfirst, $Klast );
-                if ( $excess <= 0 ) {
-
-                    # All tokens are on one line and fit. This is a valid
-                    # existing one-line weld except for some edge cases
-                    # involving -lp:
-
-                    # FIX2: Patch for b1114: add a tolerance of one level if
-                    # this line has an unbalanced start.  This helps prevent
-                    # blinkers in unusual cases for lines near the length limit
-                    # by making it more likely that RULE 2 will prevent a weld.
-                    # FIX3: for b1131: only use level difference in -lp mode.
-                    # FIX4: for b1141, b1142: reduce the tolerance for longer
-                    # leading tokens
-                    if (   $rOpts_line_up_parentheses
-                        && $outer_opening->[_LEVEL_] -
-                        $rLL->[$Kfirst]->[_LEVEL_] )
-                    {
 
-                        # We only need a tolerance if the leading text before
-                        # the first opening token is shorter than the
-                        # indentation length.  For simplicity we just use the
-                        # length of the first token here.  If necessary, we
-                        # could be more exact in the future and find the
-                        # total length up to the first opening token.
-                        # See cases b1114, b1141, b1142.
-                        my $tolx = max( 0,
-                            $rOpts_indent_columns -
-                              $rLL->[$Kfirst]->[_TOKEN_LENGTH_] );
-
-                        if ( $excess + $tolx <= 0 ) {
-                            $is_one_line_weld = 1;
-                        }
-                    }
-                    else {
-                        $is_one_line_weld = 1;
-                    }
-                }
+                # Note: coding simplified here for case b1219
+                $is_one_line_weld = $excess <= 0;
             }
 
             # DO-NOT-WELD RULE 1:
@@ -13080,7 +13042,9 @@ EOM
             $this_batch->[_do_not_pad_]               = 0;
             $this_batch->[_batch_count_]              = $batch_count;
             $this_batch->[_rix_seqno_controlling_ci_] = [];
+
             $self->send_lines_to_vertical_aligner();
+
             my $level = $levels_to_go[$ibeg];
             $self->[_last_last_line_leading_level_] =
               $self->[_last_line_leading_level_];
index b604e1bb640c2bd1149219e0f53c615ea9b73bc1..20d8f755bc7728c2578afe1e9afd245b5e4ab64a 100644 (file)
@@ -7058,7 +7058,7 @@ sub scan_identifier_do {
 
             # shouldn't happen: bad call parameter
             Fault(<<EOM);
-Program Bug: scan_identifier received bad starting token = '$tok' 
+Program Bug: scan_identifier received bad starting token = '$tok'
 EOM
         }
         $saw_type = !$saw_alpha;