From: Steve Hancock Date: Sun, 4 Aug 2024 20:02:47 +0000 (-0700) Subject: update docs for --timeout-in-seconds X-Git-Tag: 20240511.09~4 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=bd64abff67b33b5a32fe399fbabf4cb25df3035d;p=perltidy.git update docs for --timeout-in-seconds --- diff --git a/CHANGES.md b/CHANGES.md index 47cef547..cbd1df71 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -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 diff --git a/bin/perltidy b/bin/perltidy index fea1288e..8cabdd6f 100755 --- a/bin/perltidy +++ b/bin/perltidy @@ -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 and B. The types of checks which are made are identified -in the output with one of the letters, B, B, B

, and B as follows: +in the output with one of the letters, B, B, B

, B, and B 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. +=item B + +These are names which are declared with a C 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 @@ -6122,12 +6130,13 @@ types of variables to be checked. For example: perltidy -wvt='s r' somefile.pl will process F normally but issue a warning if either of -the issues 's' or 'r', but not 'p', described above, are encountered. +the issues B or B, 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 and B 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 diff --git a/lib/Perl/Tidy.pm b/lib/Perl/Tidy.pm index e33e0977..51a9b307 100644 --- a/lib/Perl/Tidy.pm +++ b/lib/Perl/Tidy.pm @@ -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 ],