]> git.donarmstrong.com Git - perltidy.git/commitdiff
update docs for --timeout-in-seconds
authorSteve Hancock <perltidy@users.sourceforge.net>
Sun, 4 Aug 2024 20:02:47 +0000 (13:02 -0700)
committerSteve Hancock <perltidy@users.sourceforge.net>
Sun, 4 Aug 2024 20:02:47 +0000 (13:02 -0700)
CHANGES.md
bin/perltidy
lib/Perl/Tidy.pm

index 47cef5476278ceb44cdbea5fc64dd9ee5ba1f352..cbd1df713a50dd8a606e011d43b250d2be87552c 100644 (file)
@@ -2,6 +2,14 @@
 
 ## 2024 05 11.08
 
+    - Add --timeout-in-seconds=n, or -to=n.  When the standard input supplies
+      the input stream, and the input has not been received within n seconds,
+      perltidy will end with a timeout message.  The intention is to catch
+      a situation where perltidy is accidentally invoked without a file to
+      process and therefore waits for input from the system standard input
+      (stdin), which never arrives.  The default is n=10.
+      This check can be turned off with -to=0.
+
     - Add parameter --closing-side-comment-exclusion-list=string, or
       -cscxl=string, where string is a list of block types to exclude
       for closing side comment operations.  Also, closing side comments
index fea1288e2c890494e69aea510b9ad36177333009..8cabdd6f4b1664a2ac604ba029e81b5665f7b208 100755 (executable)
@@ -6032,7 +6032,8 @@ meaning:
 If there are a large number of issues it can be convenient to read the file
 into a spreadsheet. The checks are for lexical variables introduced by the
 keywords B<my> and B<state>.  The types of checks which are made are identified
-in the output with one of the letters, B<r>, B<s>, B<p>, and B<u> as follows:
+in the output with one of the letters, B<r>, B<s>, B<p>, B<u>, and B<c> as
+follows:
 
 =over 4
 
@@ -6099,6 +6100,13 @@ limited to the surrounding braces, so it is not the same variable as the other
 C<$string> and must therefore be reported as unused.  This particular problem
 would have also been caught by perl if the author had used C<strict>.
 
+=item B<c: unused constants>
+
+These are names which are declared with a C<use constant> and not
+referenced again within their package. They might be needed by an
+external package, or for future development. But they might be unused
+remnants from code development, so it can be worthwhile reviewing them.
+
 =back
 
 =item B<Use --warn-variable-types to warn about certain variable types>
@@ -6122,12 +6130,13 @@ types of variables to be checked. For example:
    perltidy -wvt='s r' somefile.pl
 
 will process F<somefile.pl> normally but issue a warning if either of
-the issues 's' or 'r', but not 'p', described above, are encountered.
+the issues B<s> or B<r>, described above, are encountered.
 
-The 'u' option (unused) has a limitation: it is not allowed in a F<.perltidyrc>
-configuration file.  But it can be used on the command line provided that
-perltidy is operating on a named file.  This rule is necessary to avoid
-warnings when perltidy is run on small snippets of code from within an editor.
+The B<u> and B<c> options (unused variables and constants) have a limitation:
+they are not allowed in a F<.perltidyrc> configuration file.  But they can be
+used on the command line provided that perltidy is operating on a named file.
+This rule is necessary to avoid warnings when perltidy is run on small snippets
+of code from within an editor.
 
 A companion flag, B<--warn-variable-exclusion-list=string>, or B<-wvxl=string>,
 can be used to skip warning checks for a list of variable names.  A leading
index e33e0977622be1e66cd9a47c126eb480fa0313f6..51a9b30799ee7d1cb0f9ed5f0ae69bf42e6dc4df 100644 (file)
@@ -4080,6 +4080,7 @@ sub generate_options {
         'square-bracket-vertical-tightness'         => [ 0, 2 ],
         'square-bracket-vertical-tightness-closing' => [ 0, 3 ],
         'starting-indentation-level'                => [ 0, undef ],
+        'timeout-in-seconds'                        => [ 0, undef ],
         'vertical-tightness'                        => [ 0, 2 ],
         'vertical-tightness-closing'                => [ 0, 3 ],
         'valign-signed-numbers-limit'               => [ 0, undef ],