]> git.donarmstrong.com Git - perltidy.git/commitdiff
remove perl 5.8 from test matrix
authorSteve Hancock <perltidy@users.sourceforge.net>
Fri, 24 Jun 2022 20:14:10 +0000 (13:14 -0700)
committerSteve Hancock <perltidy@users.sourceforge.net>
Fri, 24 Jun 2022 20:14:10 +0000 (13:14 -0700)
.github/workflows/perltest.yml
.perlcriticrc
lib/Perl/Tidy/Tokenizer.pm

index 970e6894dfdec35bb67365d9c3d3733495ddfc66..d4a0ab91858a7300016fa3b2cc745ef10f0b4339 100644 (file)
@@ -26,7 +26,7 @@ jobs:
     strategy:
       matrix:
         os: ['ubuntu-latest', 'macos-latest', 'windows-latest']
-        perl: [ '5.8', '5.10', '5.12', '5.14', '5.30', '5.32', 'latest' ]
+        perl: [ '5.10', '5.12', '5.14', '5.30', '5.32', 'latest' ]
  
     # Using the value from the matrix above we select the platform (operating system) to run on
     runs-on: ${{ matrix.os }}
index f2cad15c503b1f8ef4b45d64df8b3da894bda69a..47eacb0dd1c94f1e6a194dee1a53e21d9763f810 100644 (file)
@@ -71,7 +71,7 @@ verbose = %f: [%p] %m at line %l, column %c.\n
 
 # The max values below can be reduced to locate code which might be improved.
 [Subroutines::ProhibitExcessComplexity]
-max_mccabe=245
+max_mccabe=185
 [ControlStructures::ProhibitDeepNests]
 max_nests=8
 
index 894bb70ae22f950ff79f86eb5cb8e26188f3a4c0..a05da9344232ef4fb765191976e96e7309c22dc4 100644 (file)
@@ -2047,22 +2047,23 @@ EOM
 
         my $i_begin   = $i;
         my $tok_begin = $tok;
+        my $i_plus_1  = $i + 1;
         my $fast_scan_type;
 
         ###############################
         # quick scan with leading sigil
         ###############################
         if (  !$id_scan_state
-            && $i + 1 <= $max_token_index
+            && $i_plus_1 <= $max_token_index
             && $fast_scan_context{$tok} )
         {
             $context = $fast_scan_context{$tok};
 
             # look for $var, @var, ...
-            if ( $rtoken_type->[ $i + 1 ] eq 'w' ) {
+            if ( $rtoken_type->[$i_plus_1] eq 'w' ) {
                 my $pretype_next = EMPTY_STRING;
-                my $i_next       = $i + 2;
-                if ( $i_next <= $max_token_index ) {
+                if ( $i_plus_1 < $max_token_index ) {
+                    my $i_next = $i_plus_1 + 1;
                     if (   $rtoken_type->[$i_next] eq 'b'
                         && $i_next < $max_token_index )
                     {
@@ -2073,10 +2074,10 @@ EOM
                 if ( $pretype_next ne ':' && $pretype_next ne "'" ) {
 
                     # Found type 'i' like '$var', '@var', or '%var'
-                    $identifier     = $tok . $rtokens->[ $i + 1 ];
+                    $identifier     = $tok . $rtokens->[$i_plus_1];
                     $tok            = $identifier;
                     $type           = 'i';
-                    $i              = $i + 1;
+                    $i              = $i_plus_1;
                     $fast_scan_type = $type;
                 }
             }
@@ -2085,7 +2086,7 @@ EOM
             # But we must let the full scanner handle things ${ because it may
             # keep going to get a complete identifier like '${#}'  .
             elsif (
-                $rtoken_type->[ $i + 1 ] eq '{'
+                $rtoken_type->[$i_plus_1] eq '{'
                 && (   $tok_begin eq '@'
                     || $tok_begin eq '%' )
               )
@@ -2104,8 +2105,8 @@ EOM
         elsif (
                $tok eq '->'
             && $i < $max_token_index
-            && (   $rtokens->[ $i + 1 ] eq '{'
-                || $rtokens->[ $i + 1 ] eq '[' )
+            && (   $rtokens->[$i_plus_1] eq '{'
+                || $rtokens->[$i_plus_1] eq '[' )
           )
         {
             $type           = $tok;