From c7368d524fbbfc18cd92f3fb943a7dc477f10a55 Mon Sep 17 00:00:00 2001 From: Steve Hancock Date: Mon, 13 Mar 2023 08:16:02 -0700 Subject: [PATCH] bump version to 20230309.01 This has fixes for git #110 (missing docs) and git #115 --- CHANGES.md | 12 +++ bin/perltidy | 2 +- docs/ChangeLog.html | 13 ++++ docs/Tidy.html | 4 +- docs/perltidy.html | 90 +++++++++++++++++++++- lib/Perl/Tidy.pm | 2 +- lib/Perl/Tidy.pod | 2 +- lib/Perl/Tidy/Debugger.pm | 2 +- lib/Perl/Tidy/DevNull.pm | 2 +- lib/Perl/Tidy/Diagnostics.pm | 2 +- lib/Perl/Tidy/FileWriter.pm | 2 +- lib/Perl/Tidy/Formatter.pm | 2 +- lib/Perl/Tidy/HtmlWriter.pm | 2 +- lib/Perl/Tidy/IOScalar.pm | 2 +- lib/Perl/Tidy/IOScalarArray.pm | 2 +- lib/Perl/Tidy/IndentationItem.pm | 2 +- lib/Perl/Tidy/LineBuffer.pm | 2 +- lib/Perl/Tidy/LineSink.pm | 2 +- lib/Perl/Tidy/LineSource.pm | 2 +- lib/Perl/Tidy/Logger.pm | 2 +- lib/Perl/Tidy/Tokenizer.pm | 2 +- lib/Perl/Tidy/VerticalAligner.pm | 2 +- lib/Perl/Tidy/VerticalAligner/Alignment.pm | 2 +- lib/Perl/Tidy/VerticalAligner/Line.pm | 2 +- 24 files changed, 135 insertions(+), 24 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index eb36279f..6bffaf6c 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,5 +1,17 @@ # Perltidy Change Log +## 2023 03 09.01 + + - Fixed git #115. In the two most recent CPAN releases, when the + Perl::Tidy module was called with the source pointing to a file, + but no destination specified, the output went to the standard + output instead of to a file with extension ``.tdy``, as it should + have. This has been fixed. + + - Fixed git #110, add missing documentation for new options + -cpb and -bfvt=n. These work in version 20230309 but the pod + documentation was missing and has been added. + ## 2023 03 09 - No significant bugs have been found since the last release to CPAN. diff --git a/bin/perltidy b/bin/perltidy index 796b3e1d..236493bb 100755 --- a/bin/perltidy +++ b/bin/perltidy @@ -5646,7 +5646,7 @@ The perltidy binary uses the Perl::Tidy module and is installed when that module =head1 VERSION -This man page documents perltidy version 20230309 +This man page documents perltidy version 20230309.01 =head1 BUG REPORTS diff --git a/docs/ChangeLog.html b/docs/ChangeLog.html index 2911676e..29ae0f96 100644 --- a/docs/ChangeLog.html +++ b/docs/ChangeLog.html @@ -1,5 +1,18 @@

Perltidy Change Log

+

2023 03 09.01

+ +
- Fixed git #115. In the two most recent CPAN releases, when the
+  Perl::Tidy module was called with the source pointing to a file,
+  but no destination specified, the output went to the standard
+  output instead of to a file with extension ``.tdy``, as it should
+  have.  This has been fixed.
+
+- Fixed git #110, add missing documentation for new options
+  -cpb and -bfvt=n. These work in version 20230309 but the pod
+  documentation was missing and has been added.
+
+

2023 03 09

- No significant bugs have been found since the last release to CPAN.
diff --git a/docs/Tidy.html b/docs/Tidy.html
index 400318fd..d4531607 100644
--- a/docs/Tidy.html
+++ b/docs/Tidy.html
@@ -241,8 +241,6 @@
 
 

Parameters which control formatting may be passed in several ways: in a .perltidyrc configuration file, in the perltidyrc parameter, and in the argv parameter.

-

The -syn (--check-syntax) flag may be used with all source and destination streams except for standard input and output. However data streams which are not associated with a filename will be copied to a temporary file before being passed to Perl. This use of temporary files can cause somewhat confusing output from Perl.

-

If the -pbp style is used it will typically be necessary to also specify a -nst flag. This is necessary to turn off the -st flag contained in the -pbp parameter set which otherwise would direct the output stream to the standard output.

EXAMPLES

@@ -401,7 +399,7 @@

VERSION

-

This man page documents Perl::Tidy version 20230309

+

This man page documents Perl::Tidy version 20230309.01

LICENSE

diff --git a/docs/perltidy.html b/docs/perltidy.html index b8fa37f4..b8d784e8 100644 --- a/docs/perltidy.html +++ b/docs/perltidy.html @@ -1967,6 +1967,38 @@

A conflict occurs if both -bl and -bar are specified.

+ +
-cpb, --cuddled-paren-brace
+
+ +

A related parameter, --cuddled-paren-brace, causes perltidy to join two lines which otherwise would be

+ +
      )
+    {
+ +

to be

+ +
    ) {
+ +

For example:

+ +
    # default
+    foreach my $dir (
+        '05_lexer', '07_token', '08_regression', '11_util',
+        '13_data',  '15_transform'
+      )
+    {
+        ...
+    }
+
+    # perltidy -cpb
+    foreach my $dir (
+        '05_lexer', '07_token', '08_regression', '11_util',
+        '13_data',  '15_transform'
+    ) {
+        ...;
+    }
+
@@ -2121,6 +2153,62 @@ -bbpi=1 outdent by one continuation level -bbpi=2 indent one full indentation level
+ +
-bfvt=n, --brace-follower-vertical-tightness=n
+
+ +

Some types of closing block braces, such as eval, may be followed by additional code. A line break may be inserted between such a closing brace and the following code depending on the parameter n and the length of the trailing code, as follows:

+ +

If the trailing code fits on a single line, then

+ +
  -bfvt=0 Follow the input style regarding break/no-break
+  -bfvt=1 Follow the input style regarding break/no-break [Default]
+  -bfvt=2 Do not insert a line break
+ +

If the trailing code requires multiple lines, then

+ +
  -bfvt=0 Insert a line break
+  -bfvt=1 Insert a line break except for a cuddled block chain [Default]
+  -bfvt=2 Do not insert a line break
+ +

So the most compact code is achieved with -bfvt=2.

+ +

Example (non-cuddled, multiple lines ):

+ +
    # -bfvt=0 or -bvft=1 [DEFAULT]
+    eval {
+        ( $line, $cond ) = $self->_normalize_if_elif($line);
+        1;
+    }
+      or die sprintf "Error at line %d\nLine %d: %s\n%s",
+      ( $line_info->start_line_num() ) x 2, $line, $@;
+
+    # -bfvt=2
+    eval {
+        ( $line, $cond ) = $self->_normalize_if_elif($line);
+        1;
+    } or die sprintf "Error at line %d\nLine %d: %s\n%s",
+      ( $line_info->start_line_num() ) x 2, $line, $@;
+ +

Example (cuddled, multiple lines):

+ +
    # -bfvt=0
+    eval {
+        #STUFF;
+        1;    # return true
+    }
+      or do {
+        ##handle error
+      };
+
+    # -bfvt=1 [DEFAULT] or -bfvt=2
+    eval {
+        #STUFF;
+        1;    # return true
+    } or do {
+        ##handle error
+    };
+
@@ -4317,7 +4405,7 @@

VERSION

-

This man page documents perltidy version 20230309

+

This man page documents perltidy version 20230309.01

BUG REPORTS

diff --git a/lib/Perl/Tidy.pm b/lib/Perl/Tidy.pm index 9695ea48..d5c345c4 100644 --- a/lib/Perl/Tidy.pm +++ b/lib/Perl/Tidy.pm @@ -113,7 +113,7 @@ BEGIN { # then the Release version must be bumped, and it is probably past time for # a release anyway. - $VERSION = '20230309'; + $VERSION = '20230309.01'; } ## end BEGIN sub DESTROY { diff --git a/lib/Perl/Tidy.pod b/lib/Perl/Tidy.pod index 66387640..5e04244b 100644 --- a/lib/Perl/Tidy.pod +++ b/lib/Perl/Tidy.pod @@ -469,7 +469,7 @@ The module 'Perl::Tidy' comes with a binary 'perltidy' which is installed when t =head1 VERSION -This man page documents Perl::Tidy version 20230309 +This man page documents Perl::Tidy version 20230309.01 =head1 LICENSE diff --git a/lib/Perl/Tidy/Debugger.pm b/lib/Perl/Tidy/Debugger.pm index 457da0d5..98215ac1 100644 --- a/lib/Perl/Tidy/Debugger.pm +++ b/lib/Perl/Tidy/Debugger.pm @@ -8,7 +8,7 @@ package Perl::Tidy::Debugger; use strict; use warnings; use English qw( -no_match_vars ); -our $VERSION = '20230309'; +our $VERSION = '20230309.01'; use constant EMPTY_STRING => q{}; use constant SPACE => q{ }; diff --git a/lib/Perl/Tidy/DevNull.pm b/lib/Perl/Tidy/DevNull.pm index 7253a6bb..b6b28c24 100644 --- a/lib/Perl/Tidy/DevNull.pm +++ b/lib/Perl/Tidy/DevNull.pm @@ -7,7 +7,7 @@ package Perl::Tidy::DevNull; use strict; use warnings; -our $VERSION = '20230309'; +our $VERSION = '20230309.01'; sub new { my $self = shift; return bless {}, $self } sub print { return } sub close { return } diff --git a/lib/Perl/Tidy/Diagnostics.pm b/lib/Perl/Tidy/Diagnostics.pm index 847a1f04..4d9b6b19 100644 --- a/lib/Perl/Tidy/Diagnostics.pm +++ b/lib/Perl/Tidy/Diagnostics.pm @@ -21,7 +21,7 @@ package Perl::Tidy::Diagnostics; use strict; use warnings; use English qw( -no_match_vars ); -our $VERSION = '20230309'; +our $VERSION = '20230309.01'; use constant EMPTY_STRING => q{}; diff --git a/lib/Perl/Tidy/FileWriter.pm b/lib/Perl/Tidy/FileWriter.pm index 834d1adf..debc3760 100644 --- a/lib/Perl/Tidy/FileWriter.pm +++ b/lib/Perl/Tidy/FileWriter.pm @@ -7,7 +7,7 @@ package Perl::Tidy::FileWriter; use strict; use warnings; -our $VERSION = '20230309'; +our $VERSION = '20230309.01'; use constant DEVEL_MODE => 0; use constant EMPTY_STRING => q{}; diff --git a/lib/Perl/Tidy/Formatter.pm b/lib/Perl/Tidy/Formatter.pm index d2f9f037..7a8638e4 100644 --- a/lib/Perl/Tidy/Formatter.pm +++ b/lib/Perl/Tidy/Formatter.pm @@ -53,7 +53,7 @@ use constant SPACE => q{ }; use Carp; use English qw( -no_match_vars ); use List::Util qw( min max ); # min, max are in Perl 5.8 -our $VERSION = '20230309'; +our $VERSION = '20230309.01'; # The Tokenizer will be loaded with the Formatter ##use Perl::Tidy::Tokenizer; # for is_keyword() diff --git a/lib/Perl/Tidy/HtmlWriter.pm b/lib/Perl/Tidy/HtmlWriter.pm index 02acb00a..d3adf1ff 100644 --- a/lib/Perl/Tidy/HtmlWriter.pm +++ b/lib/Perl/Tidy/HtmlWriter.pm @@ -7,7 +7,7 @@ package Perl::Tidy::HtmlWriter; use strict; use warnings; -our $VERSION = '20230309'; +our $VERSION = '20230309.01'; use English qw( -no_match_vars ); use File::Basename; diff --git a/lib/Perl/Tidy/IOScalar.pm b/lib/Perl/Tidy/IOScalar.pm index 66b674b2..b69e4a1c 100644 --- a/lib/Perl/Tidy/IOScalar.pm +++ b/lib/Perl/Tidy/IOScalar.pm @@ -10,7 +10,7 @@ package Perl::Tidy::IOScalar; use strict; use warnings; use Carp; -our $VERSION = '20230309'; +our $VERSION = '20230309.01'; use constant EMPTY_STRING => q{}; diff --git a/lib/Perl/Tidy/IOScalarArray.pm b/lib/Perl/Tidy/IOScalarArray.pm index 3894cc44..a5ddc130 100644 --- a/lib/Perl/Tidy/IOScalarArray.pm +++ b/lib/Perl/Tidy/IOScalarArray.pm @@ -14,7 +14,7 @@ package Perl::Tidy::IOScalarArray; use strict; use warnings; use Carp; -our $VERSION = '20230309'; +our $VERSION = '20230309.01'; sub AUTOLOAD { diff --git a/lib/Perl/Tidy/IndentationItem.pm b/lib/Perl/Tidy/IndentationItem.pm index 55390821..a6d4f3e8 100644 --- a/lib/Perl/Tidy/IndentationItem.pm +++ b/lib/Perl/Tidy/IndentationItem.pm @@ -8,7 +8,7 @@ package Perl::Tidy::IndentationItem; use strict; use warnings; -our $VERSION = '20230309'; +our $VERSION = '20230309.01'; BEGIN { diff --git a/lib/Perl/Tidy/LineBuffer.pm b/lib/Perl/Tidy/LineBuffer.pm index 7665e37e..1dc1ed20 100644 --- a/lib/Perl/Tidy/LineBuffer.pm +++ b/lib/Perl/Tidy/LineBuffer.pm @@ -12,7 +12,7 @@ package Perl::Tidy::LineBuffer; use strict; use warnings; -our $VERSION = '20230309'; +our $VERSION = '20230309.01'; sub AUTOLOAD { diff --git a/lib/Perl/Tidy/LineSink.pm b/lib/Perl/Tidy/LineSink.pm index 6516a987..079258a6 100644 --- a/lib/Perl/Tidy/LineSink.pm +++ b/lib/Perl/Tidy/LineSink.pm @@ -8,7 +8,7 @@ package Perl::Tidy::LineSink; use strict; use warnings; -our $VERSION = '20230309'; +our $VERSION = '20230309.01'; sub AUTOLOAD { diff --git a/lib/Perl/Tidy/LineSource.pm b/lib/Perl/Tidy/LineSource.pm index 8bf97b91..b442e97d 100644 --- a/lib/Perl/Tidy/LineSource.pm +++ b/lib/Perl/Tidy/LineSource.pm @@ -9,7 +9,7 @@ package Perl::Tidy::LineSource; use strict; use warnings; use English qw( -no_match_vars ); -our $VERSION = '20230309'; +our $VERSION = '20230309.01'; use constant DEVEL_MODE => 0; diff --git a/lib/Perl/Tidy/Logger.pm b/lib/Perl/Tidy/Logger.pm index fa3f5284..e195ae46 100644 --- a/lib/Perl/Tidy/Logger.pm +++ b/lib/Perl/Tidy/Logger.pm @@ -8,7 +8,7 @@ package Perl::Tidy::Logger; use strict; use warnings; -our $VERSION = '20230309'; +our $VERSION = '20230309.01'; use English qw( -no_match_vars ); use constant DEVEL_MODE => 0; diff --git a/lib/Perl/Tidy/Tokenizer.pm b/lib/Perl/Tidy/Tokenizer.pm index 8d16dd2f..0c861a03 100644 --- a/lib/Perl/Tidy/Tokenizer.pm +++ b/lib/Perl/Tidy/Tokenizer.pm @@ -23,7 +23,7 @@ use strict; use warnings; use English qw( -no_match_vars ); -our $VERSION = '20230309'; +our $VERSION = '20230309.01'; use Perl::Tidy::LineBuffer; use Carp; diff --git a/lib/Perl/Tidy/VerticalAligner.pm b/lib/Perl/Tidy/VerticalAligner.pm index f582c6a8..29c631f5 100644 --- a/lib/Perl/Tidy/VerticalAligner.pm +++ b/lib/Perl/Tidy/VerticalAligner.pm @@ -3,7 +3,7 @@ use strict; use warnings; use Carp; use English qw( -no_match_vars ); -our $VERSION = '20230309'; +our $VERSION = '20230309.01'; use Perl::Tidy::VerticalAligner::Alignment; use Perl::Tidy::VerticalAligner::Line; diff --git a/lib/Perl/Tidy/VerticalAligner/Alignment.pm b/lib/Perl/Tidy/VerticalAligner/Alignment.pm index 50edd51a..9cdd15c6 100644 --- a/lib/Perl/Tidy/VerticalAligner/Alignment.pm +++ b/lib/Perl/Tidy/VerticalAligner/Alignment.pm @@ -10,7 +10,7 @@ use warnings; { #<<< A non-indenting brace -our $VERSION = '20230309'; +our $VERSION = '20230309.01'; sub new { my ( $class, $rarg ) = @_; diff --git a/lib/Perl/Tidy/VerticalAligner/Line.pm b/lib/Perl/Tidy/VerticalAligner/Line.pm index a1994601..c4924b73 100644 --- a/lib/Perl/Tidy/VerticalAligner/Line.pm +++ b/lib/Perl/Tidy/VerticalAligner/Line.pm @@ -10,7 +10,7 @@ package Perl::Tidy::VerticalAligner::Line; use strict; use warnings; use English qw( -no_match_vars ); -our $VERSION = '20230309'; +our $VERSION = '20230309.01'; sub AUTOLOAD { -- 2.39.5