]> git.donarmstrong.com Git - perltidy.git/commitdiff
Added returns for PerlCritic
authorSteve Hancock <perltidy@users.sourceforge.net>
Tue, 28 May 2019 14:50:02 +0000 (07:50 -0700)
committerSteve Hancock <perltidy@users.sourceforge.net>
Tue, 28 May 2019 14:50:02 +0000 (07:50 -0700)
lib/Perl/Tidy/VerticalAligner.pm

index 185dd16c0662c865f6521388b1348c0665bafb66..2c7a79238820e706ac4e6de76988f5fec9ea6e14 100644 (file)
@@ -316,6 +316,7 @@ sub push_group_line {
 
     my ($new_line) = @_;
     push @group_lines, $new_line;
+    return;
 }
 
 sub valign_input {
@@ -2010,6 +2011,7 @@ sub my_flush_code {
     }
 
     initialize_for_new_group();
+    return;
 }
 
 sub my_flush {
@@ -2034,17 +2036,17 @@ sub my_flush {
     # handle group(s) of CODE lines
     else {
 
-       # LP FIX PART 1
-       # If we are trying to add extra indentation for -lp formatting,
-       # then we need to try to keep the group intact.  But we have
-       # to set the $extra_indent_ok flag to zero in case some lines
-       # are output separately.  We fix things up at the bottom.
-       # NOTE: this is a workaround but is tentative; we should really look to
-       # see if if extra indentation is possible.
-       my $rOpt_lp = $rOpts->{'line-up-parentheses'};
-       my $keep_group_intact = $rOpt_lp && $extra_indent_ok;
-       my $extra_indent_ok_save = $extra_indent_ok;
-       $extra_indent_ok = 0;
+        # LP FIX PART 1
+        # If we are trying to add extra indentation for -lp formatting,
+        # then we need to try to keep the group intact.  But we have
+        # to set the $extra_indent_ok flag to zero in case some lines
+        # are output separately.  We fix things up at the bottom.
+        # NOTE: this is a workaround but is tentative; we should really look to
+        # see if if extra indentation is possible.
+        my $rOpt_lp              = $rOpts->{'line-up-parentheses'};
+        my $keep_group_intact    = $rOpt_lp && $extra_indent_ok;
+        my $extra_indent_ok_save = $extra_indent_ok;
+        $extra_indent_ok = 0;
 
         # we will rebuild alignment line group(s);
         my @new_lines = @group_lines;
@@ -2092,12 +2094,12 @@ sub my_flush {
                 join_hanging_comment( $new_line, $base_line );
             }
 
-           # If this line has no matching tokens, then flush out the lines
-           # BEFORE this line unless both it and the previous line have side
-           # comments.  This prevents this line from pushing side coments out
-           # to the right.
+            # If this line has no matching tokens, then flush out the lines
+            # BEFORE this line unless both it and the previous line have side
+            # comments.  This prevents this line from pushing side coments out
+            # to the right.
             ##elsif ( $new_line->get_jmax() == 1 ) {
-            elsif ( $new_line->get_jmax() == 1 && !$keep_group_intact) {
+            elsif ( $new_line->get_jmax() == 1 && !$keep_group_intact ) {
 
                 # There are no matching tokens, so now check side comments:
                 my $prev_comment = $group_lines[-1]->get_rfields()->[-1];
@@ -2177,9 +2179,9 @@ sub my_flush {
             }
         }
 
-       # LP FIX PART 2
-       # if we managed to keep the group intact for -lp formatting,
-       # restore the flag which allows extra indentation
+        # LP FIX PART 2
+        # if we managed to keep the group intact for -lp formatting,
+        # restore the flag which allows extra indentation
         if ( $keep_group_intact && @group_lines == @new_lines ) {
             $extra_indent_ok = $extra_indent_ok_save;
         }
@@ -2265,6 +2267,7 @@ new tokens: <@{$rtokens_new}>
 new patterns: <@{$rpatterns_new}>
 new fields: <@{$rfields_new}>
 EOM
+    return;
 }
 
 {    # sub is_deletable_token
@@ -3262,4 +3265,3 @@ sub report_anything_unusual {
     return;
 }
 1;
-