]> git.donarmstrong.com Git - perltidy.git/commitdiff
update documentation and comments
authorSteve Hancock <perltidy@users.sourceforge.net>
Thu, 29 Oct 2020 13:48:01 +0000 (06:48 -0700)
committerSteve Hancock <perltidy@users.sourceforge.net>
Thu, 29 Oct 2020 13:48:01 +0000 (06:48 -0700)
CHANGES.md
bin/perltidy
lib/Perl/Tidy.pm
lib/Perl/Tidy/Tokenizer.pm
local-docs/BugLog.pod

index f7611bc58f0927b2bb7a0e678ca9c1569a95d89f..e0295e429c9bc627f1f9be09cbd7788c8120b0eb 100644 (file)
@@ -2,6 +2,10 @@
 
 ## 2020 10 01.02
 
+    - Fix git #44, fix exit status for assert-tidy/untidy.  The exit status was
+      always 0 for --assert-tidy if the user had turned off all error messages with
+      the -quiet.  This has been fixed.
+
     - Add flag -mfs=n, --maximum-file-size-mb=n.  This parameter is provided to
       avoid causing system problems by accidentally attempting to format an 
       extremely large data file. The default is n=10.  The command to increase 
index 161c22fb44e8e51a0ea156b528e6220c9bfa321a..aa2f1973c116976b37c4b888930a8d2a47dbe4af 100755 (executable)
@@ -284,8 +284,7 @@ B<--nowarning-output>, is not to include these warnings.
 
 =item B<-q>,    B<--quiet>             
 
-Deactivate error messages and syntax checking (for running under
-an editor). 
+Deactivate error messages (for running under an editor). 
 
 For example, if you use a vi-style editor, such as vim, you may execute
 perltidy as a filter from within the editor using something like
@@ -368,6 +367,8 @@ This error message will cause the process to return a non-zero exit code.
 The test for this is made by comparing an MD5 hash value for the input and
 output code streams. This flag has no other effect on the functioning of
 perltidy.  This might be useful for certain code maintenance operations.
+Note: you will not see this message if you have error messages turned off with the
+-quiet flag.
 
 =item B<-asu>,   B<--assert-untidy>      
 
index adc885943f7e435bb250967153561da4369fe6e3..45f11178670594acf63e21e64ca108d053aa9c2b 100644 (file)
@@ -1528,7 +1528,7 @@ EOM
                     $logger_object->interrupt_logfile();
                     $logger_object->warning( $diff_msg . "\n" );
                     $logger_object->resume_logfile();
-                    $Warn_count++;
+                    $Warn_count++;  # insure correct exit if -q flag is set
                 }
             }
             if ( $rOpts->{'assert-untidy'} ) {
@@ -1537,7 +1537,7 @@ EOM
                     $logger_object->warning(
 "assertion failure: '--assert-untidy' is set but output equals input\n"
                     );
-                    $Warn_count++;
+                    $Warn_count++;  # insure correct exit if -q flag is set
                 }
             }
 
index 60cd771d7999727e0488af9cb57b78e162371aaa..2fd90f47a9e55522cde4e26527f34cc7f51220e3 100644 (file)
@@ -3205,7 +3205,7 @@ EOM
                     if ( $next_nonblank_token eq '(' ) {
 
                         # For something like:
-                        #     : prototype($$) 
+                        #     : prototype($$)
                         # we should let do_scan_sub see it so that it can see
                         # the prototype.  All other attributes get parsed as a
                         # quoted string.
@@ -3226,14 +3226,14 @@ EOM
                                 max_token_index => $max_token_index
                             );
 
-                            # If successful, mark as type 'q' to be consistent with other
-                            # attributes.  Note that type 'w' would also work.
+                   # If successful, mark as type 'q' to be consistent with other
+                   # attributes.  Note that type 'w' would also work.
                             if ( $i > $i_beg ) {
-                                $type = 'q';    
+                                $type = 'q';
                                 next;
                             }
 
-                            # If not successful, fall through and parse as a quote.
+                            # If not successful, continue and parse as a quote.
                         }
 
                         # All other attribute lists must be parsed as quotes
@@ -6739,6 +6739,7 @@ sub scan_identifier_do {
     sub initialize_subname {
         $package_saved = "";
         $subname_saved = "";
+        return;
     }
 
     use constant {
@@ -6801,7 +6802,7 @@ sub scan_identifier_do {
         my $id_scan_state   = $input_hash{id_scan_state};
         my $max_token_index = $input_hash{max_token_index};
 
-        # Determine the CALL TYPE 
+        # Determine the CALL TYPE
         # 1=sub
         # 2=(
         # 3=prototype
@@ -6874,9 +6875,9 @@ sub scan_identifier_do {
             $proto = $1;
             $attrs = $2;
 
-           # Append the prototype to the starting token if it is 'sub' or
-           # 'prototype'.  This is not necessary but for compatibility with previous
-            # versions when the -csc flag is used:
+       # Append the prototype to the starting token if it is 'sub' or
+       # 'prototype'.  This is not necessary but for compatibility with previous
+       # versions when the -csc flag is used:
             if ( $proto && ( $match || $call_type == PROTOTYPE_CALL ) ) {
                 $tok .= $proto;
             }
index b4e451c4af79c9fd7c67379df2f420b0fc9fdfc5..ff3f8dd07bfc1d5ed211292fbf822237e379f2de 100644 (file)
@@ -2,6 +2,11 @@
 
 =over 4
 
+=item b<Update for git #44, fix exit status for assert-tidy/untidy>
+
+The exit status was always 0 for --assert-tidy if the user had turned off error
+messages with -quiet.  This has been fixed.
+
 =item b<Fixed problem parsing extruded signature>
 
 A parsing error was encountered in a test parsing the following extruded