]> git.donarmstrong.com Git - perltidy.git/commitdiff
activate RegularExpressions::ProhibitComplexRegexes
authorSteve Hancock <perltidy@users.sourceforge.net>
Wed, 30 Aug 2023 02:06:59 +0000 (19:06 -0700)
committerSteve Hancock <perltidy@users.sourceforge.net>
Wed, 30 Aug 2023 02:06:59 +0000 (19:06 -0700)
Had to use a large count. First tried to use ##no critic but hit PC bugs

.perlcriticrc
lib/Perl/Tidy/Formatter.pm

index a96aa5c0a9e6db52a163fb46b7c145b60e8c3c4f..4d1edd25bfdcdb5d4bbbda05f847332f1b20ee56 100644 (file)
@@ -15,7 +15,7 @@
 # rigid rules.
 
 # I have found the '## no critic' method for locally deactivating specific
-# policies with comments to be very troublesome to use.
+# policies to be too buggy to use.
 
 # severity = 1 gives the most strict checking.
 severity = 1
@@ -101,8 +101,10 @@ max_nests=9
 
 # There is one complex regex in Tokenizer.pm for scanning numbers. It is
 # well commented and easy to read, and any changes would make it harder
-# to read. So we have to skip this.
-[-RegularExpressions::ProhibitComplexRegexes]
+# to read. But rather than deactivate this policy, I have adjusted the
+# maximum number of characters to let this regex pass.
+[RegularExpressions::ProhibitComplexRegexes]
+max_characters=250
 
 # A problem with ReqireExtendedFormatting is that it makes things needlessly
 # complex when matching things like line feeds and carriage returns. So
index 47bbaaaf81566f3d74893223ef514ccd434de19d..d40b2b06c36032eb65cc940916945d9ba9079075 100644 (file)
@@ -7457,8 +7457,6 @@ sub set_ci {
         #---------------------------------
         # The next token after a ';' and label (type 'J') starts a new stmt
         # The ci after a C-style for ';' (type 'f') is handled similarly.
-        # TODO: There is type 'f' redundant coding in sub respace which can
-        # be removed if this becomes the standard routine for computing ci.
         elsif ( $type eq ';' || $type eq 'J' || $type eq 'f' ) {
             $ci_next = 0;
             if ( $is_closing_type{$last_type} ) { $ci_this = $ci_last }