From: Steve Hancock Date: Tue, 4 Jan 2022 15:09:42 +0000 (-0800) Subject: bump version to 20211029.05 X-Git-Tag: 20211029.05^0 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=cfd36a57ef22692f7263555318f0ad0cc9e26356;p=perltidy.git bump version to 20211029.05 --- diff --git a/CHANGES.md b/CHANGES.md index 2381365a..9ac5a6f9 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,6 +1,6 @@ # Perltidy Change Log -## 2021 10 29.04 +## 2021 10 29.05 - Two new flags have been added to provide finer vertical alignment control, --valign-exclusion-list=s (-vxl=s) and --valign-inclusion-list=s (-vil=s). diff --git a/bin/perltidy b/bin/perltidy index 54634a54..6781835d 100755 --- a/bin/perltidy +++ b/bin/perltidy @@ -4188,20 +4188,19 @@ alignment will not occur if B<-nvbc> is set. The default is B<-vbc>. =item B -More detailed control of alignment types is available with these two parameters. -Most of the alignments in typical programs occur at one of the tokens ',' '=', -and '=>', but many others are possible. The complete list of token types where -vertical alignment can occur is: +More detailed control of alignment types is available with these two +parameters. Most of the vertical alignments in typical programs occur at one +of the tokens ',', '=', and '=>', but many other alignments are possible and are given in the following list: = **= += *= &= <<= &&= -= /= |= >>= ||= //= .= %= ^= x= { ( ? : , ; => && || ~~ !~~ =~ !~ // <=> -> if unless and or err for foreach while until -These alignments are all enabled by default, but they can be selectively disabled by including one or more of these tokens in the list B. For example, the following would prevent alignment at B<=> and B: +These alignments are all enabled by default, but they can be selectively disabled by including one or more of these tokens in the space-separated list B. For example, the following would prevent alignment at B<=> and B: --valign-exclusion-list='= if' -If it is simpler to specify only the token types which are to be aligned, use the special symbol B<*> for this list and include the types which are to be aligned in the list of B<--valign-inclusion-list>. For example, +If it is simpler to specify only the token types which are to be aligned, then use the special symbol B<*> for this exclusion list and include the types which are to be aligned in the list of B<--valign-inclusion-list> (this works because B<*> is not one of the alignment tokens). For example, the following parameters enable alignment only at commas and 'fat commas': --valign-exclusion-list='*' @@ -4212,6 +4211,11 @@ list of possible alignment tokens. If an unrecognized parameter appears, it is simply ignored. And if a parameter is entered in both lists by mistake then the exclusion list has priority. +The default values of these parameters enable all alignments and are equivalent to + + --valign-exclusion-list=' ' + --valign-inclusion-list='*' + To illustrate, consider the following snippet with default formatting # perltidy @@ -4234,11 +4238,11 @@ To exclude only the equals we could use: $co_unused = ($color) ? 'on_green' : 'reverse'; # unused Notice in this last example that although only the equals alignment was -excluded, the ternary alignments were also lost. This happens because -alignments are formed from left-to-right, and if an alignment cannot be made -then potential alignments to its right might be skipped to avoid poor alignments. +excluded, the ternary alignments were also lost. This happens because the +vertical aligner sweeps from left-to-right and usually stops if an important +alignment cannot be made for some reason. -Also notice side comments remain aligned because their alignment is +But also notice that side comments remain aligned because their alignment is controlled separately with the parameter B<--valign-side_comments> described above. =back @@ -4981,7 +4985,7 @@ The perltidy binary uses the Perl::Tidy module and is installed when that module =head1 VERSION -This man page documents perltidy version 20211029.04 +This man page documents perltidy version 20211029.05 =head1 BUG REPORTS diff --git a/docs/ChangeLog.html b/docs/ChangeLog.html index 51cd83f2..8868e143 100644 --- a/docs/ChangeLog.html +++ b/docs/ChangeLog.html @@ -1,8 +1,12 @@

Perltidy Change Log

-

2021 10 29.04

+

2021 10 29.05

-
- A new flag -gal=s, --grep-alias-list=s, has been added as suggested in
+
- Two new flags have been added to provide finer vertical alignment control,
+  --valign-exclusion-list=s (-vxl=s) and  --valign-inclusion-list=s (-vil=s).
+  This has been requested several times, recently in git #79.
+
+- A new flag -gal=s, --grep-alias-list=s, has been added as suggested in
   git #77.  This allows code blocks passed to list operator functions to
   be formatted in the same way as a code block passed to grep, map, or sort.
   By default, the following list operators in List::Util are included:
diff --git a/docs/Tidy.html b/docs/Tidy.html
index f7583156..6b001c22 100644
--- a/docs/Tidy.html
+++ b/docs/Tidy.html
@@ -372,7 +372,7 @@
 
 

VERSION

-

This man page documents Perl::Tidy version 20211029.04

+

This man page documents Perl::Tidy version 20211029.05

LICENSE

diff --git a/docs/perltidy.html b/docs/perltidy.html index f9d99d7d..7bf8970d 100644 --- a/docs/perltidy.html +++ b/docs/perltidy.html @@ -3297,7 +3297,7 @@
Controlling code alignment with --valign-code or -vc
-

The -vc flag enables alignment of code symbols such as =. The default is -vc.

+

The -vc flag enables alignment of code symbols such as =. The default is -vc. For detailed control of which symbols to align, see the -valign-exclude-list parameter below.

Controlling side comment alignment with --valign-side-comments or -vsc
@@ -3311,6 +3311,57 @@

When -vbc is enabled, block comments can become aligned for example if one comment of a consecutive sequence of comments becomes outdented due a length in excess of the maximum line length. If this occurs, the entire group of comments will remain aligned and be outdented by the same amount. This coordinated alignment will not occur if -nvbc is set. The default is -vbc.

+ +
Finer alignment control with --valign-exclusion-list=s or -vxl=s and --valign-inclusion-list=s or -vil=s
+
+ +

More detailed control of alignment types is available with these two parameters. Most of the vertical alignments in typical programs occur at one of the tokens ',', '=', and '=>', but many other alignments are possible and are given in the following list:

+ +
  = **= += *= &= <<= &&= -= /= |= >>= ||= //= .= %= ^= x=
+  { ( ? : , ; => && || ~~ !~~ =~ !~ // <=> ->
+  if unless and or err for foreach while until
+ +

These alignments are all enabled by default, but they can be selectively disabled by including one or more of these tokens in the space-separated list valign-exclusion-list=s. For example, the following would prevent alignment at = and if:

+ +
  --valign-exclusion-list='= if'
+ +

If it is simpler to specify only the token types which are to be aligned, then use the special symbol * for this exclusion list and include the types which are to be aligned in the list of --valign-inclusion-list (this works because * is not one of the alignment tokens). For example, the following parameters enable alignment only at commas and 'fat commas':

+ +
  --valign-exclusion-list='*'
+  --valign-inclusion-list=', =>'
+ +

These parameter lists should consist of space-separated tokens from the above list of possible alignment tokens. If an unrecognized parameter appears, it is simply ignored. And if a parameter is entered in both lists by mistake then the exclusion list has priority.

+ +

The default values of these parameters enable all alignments and are equivalent to

+ +
  --valign-exclusion-list=' '
+  --valign-inclusion-list='*'
+ +

To illustrate, consider the following snippet with default formatting

+ +
    # perltidy
+    $co_description = ($color) ? 'bold cyan'  : '';           # description
+    $co_prompt      = ($color) ? 'bold green' : '';           # prompt
+    $co_unused      = ($color) ? 'on_green'   : 'reverse';    # unused
+ +

To exclude all alignments except the equals we could use:

+ +
    # perltidy -vxl='*' -vil='='
+    $co_description = ($color) ? 'bold cyan' : '';          # description
+    $co_prompt      = ($color) ? 'bold green' : '';         # prompt
+    $co_unused      = ($color) ? 'on_green' : 'reverse';    # unused
+ +

To exclude only the equals we could use:

+ +
    # perltidy -vxl='='
+    $co_description = ($color) ? 'bold cyan' : '';     # description
+    $co_prompt = ($color) ? 'bold green' : '';         # prompt
+    $co_unused = ($color) ? 'on_green' : 'reverse';    # unused
+ +

Notice in this last example that although only the equals alignment was excluded, the ternary alignments were also lost. This happens because the vertical aligner sweeps from left-to-right and usually stops if an important alignment cannot be made for some reason.

+ +

But also notice that side comments remain aligned because their alignment is controlled separately with the parameter --valign-side_comments described above.

+
@@ -3824,7 +3875,7 @@

VERSION

-

This man page documents perltidy version 20211029.04

+

This man page documents perltidy version 20211029.05

BUG REPORTS

diff --git a/lib/Perl/Tidy.pm b/lib/Perl/Tidy.pm index dbdfcf05..53b6e29c 100644 --- a/lib/Perl/Tidy.pm +++ b/lib/Perl/Tidy.pm @@ -110,7 +110,7 @@ BEGIN { # Release version must be bumped, and it is probably past time for a # release anyway. - $VERSION = '20211029.04'; + $VERSION = '20211029.05'; } sub DESTROY { diff --git a/lib/Perl/Tidy.pod b/lib/Perl/Tidy.pod index 7e9509ff..aaaf72a3 100644 --- a/lib/Perl/Tidy.pod +++ b/lib/Perl/Tidy.pod @@ -432,7 +432,7 @@ The module 'Perl::Tidy' comes with a binary 'perltidy' which is installed when t =head1 VERSION -This man page documents Perl::Tidy version 20211029.04 +This man page documents Perl::Tidy version 20211029.05 =head1 LICENSE diff --git a/lib/Perl/Tidy/Debugger.pm b/lib/Perl/Tidy/Debugger.pm index 123fac89..2e0bfe80 100644 --- a/lib/Perl/Tidy/Debugger.pm +++ b/lib/Perl/Tidy/Debugger.pm @@ -7,7 +7,7 @@ package Perl::Tidy::Debugger; use strict; use warnings; -our $VERSION = '20211029.04'; +our $VERSION = '20211029.05'; sub new { diff --git a/lib/Perl/Tidy/DevNull.pm b/lib/Perl/Tidy/DevNull.pm index 0c0506e7..95eff269 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 = '20211029.04'; +our $VERSION = '20211029.05'; 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 d01406f2..4ad6a10e 100644 --- a/lib/Perl/Tidy/Diagnostics.pm +++ b/lib/Perl/Tidy/Diagnostics.pm @@ -20,7 +20,7 @@ package Perl::Tidy::Diagnostics; use strict; use warnings; -our $VERSION = '20211029.04'; +our $VERSION = '20211029.05'; sub AUTOLOAD { diff --git a/lib/Perl/Tidy/FileWriter.pm b/lib/Perl/Tidy/FileWriter.pm index 8957f882..d036935f 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 = '20211029.04'; +our $VERSION = '20211029.05'; use constant DEVEL_MODE => 0; diff --git a/lib/Perl/Tidy/Formatter.pm b/lib/Perl/Tidy/Formatter.pm index f1cb62a4..63f66a84 100644 --- a/lib/Perl/Tidy/Formatter.pm +++ b/lib/Perl/Tidy/Formatter.pm @@ -49,7 +49,7 @@ use constant DEVEL_MODE => 0; { #<<< A non-indenting brace to contain all lexical variables use Carp; -our $VERSION = '20211029.04'; +our $VERSION = '20211029.05'; # 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 e5e2f15a..ca22b58a 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 = '20211029.04'; +our $VERSION = '20211029.05'; use File::Basename; diff --git a/lib/Perl/Tidy/IOScalar.pm b/lib/Perl/Tidy/IOScalar.pm index baa2e4b6..9793c5d2 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 = '20211029.04'; +our $VERSION = '20211029.05'; sub AUTOLOAD { diff --git a/lib/Perl/Tidy/IOScalarArray.pm b/lib/Perl/Tidy/IOScalarArray.pm index aff25afb..d139ea1a 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 = '20211029.04'; +our $VERSION = '20211029.05'; sub AUTOLOAD { diff --git a/lib/Perl/Tidy/IndentationItem.pm b/lib/Perl/Tidy/IndentationItem.pm index feaba4b0..310ce4b0 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 = '20211029.04'; +our $VERSION = '20211029.05'; BEGIN { diff --git a/lib/Perl/Tidy/LineBuffer.pm b/lib/Perl/Tidy/LineBuffer.pm index 4ae4db42..b6080288 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 = '20211029.04'; +our $VERSION = '20211029.05'; sub AUTOLOAD { diff --git a/lib/Perl/Tidy/LineSink.pm b/lib/Perl/Tidy/LineSink.pm index f2794524..4172a307 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 = '20211029.04'; +our $VERSION = '20211029.05'; sub AUTOLOAD { diff --git a/lib/Perl/Tidy/LineSource.pm b/lib/Perl/Tidy/LineSource.pm index 66749146..c663fc0f 100644 --- a/lib/Perl/Tidy/LineSource.pm +++ b/lib/Perl/Tidy/LineSource.pm @@ -8,7 +8,7 @@ package Perl::Tidy::LineSource; use strict; use warnings; -our $VERSION = '20211029.04'; +our $VERSION = '20211029.05'; sub AUTOLOAD { diff --git a/lib/Perl/Tidy/Logger.pm b/lib/Perl/Tidy/Logger.pm index 7b852ebd..e459b4ed 100644 --- a/lib/Perl/Tidy/Logger.pm +++ b/lib/Perl/Tidy/Logger.pm @@ -7,7 +7,7 @@ package Perl::Tidy::Logger; use strict; use warnings; -our $VERSION = '20211029.04'; +our $VERSION = '20211029.05'; sub AUTOLOAD { diff --git a/lib/Perl/Tidy/Tokenizer.pm b/lib/Perl/Tidy/Tokenizer.pm index 8ef912ed..90dce9d0 100644 --- a/lib/Perl/Tidy/Tokenizer.pm +++ b/lib/Perl/Tidy/Tokenizer.pm @@ -21,7 +21,7 @@ package Perl::Tidy::Tokenizer; use strict; use warnings; -our $VERSION = '20211029.04'; +our $VERSION = '20211029.05'; # this can be turned on for extra checking during development use constant DEVEL_MODE => 0; diff --git a/lib/Perl/Tidy/VerticalAligner.pm b/lib/Perl/Tidy/VerticalAligner.pm index 3da02ef5..2eb1e6cb 100644 --- a/lib/Perl/Tidy/VerticalAligner.pm +++ b/lib/Perl/Tidy/VerticalAligner.pm @@ -2,7 +2,7 @@ package Perl::Tidy::VerticalAligner; use strict; use warnings; use Carp; -our $VERSION = '20211029.04'; +our $VERSION = '20211029.05'; 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 e67c09c5..0a548eff 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 = '20211029.04'; +our $VERSION = '20211029.05'; BEGIN { diff --git a/lib/Perl/Tidy/VerticalAligner/Line.pm b/lib/Perl/Tidy/VerticalAligner/Line.pm index 8a236ff9..d90e7221 100644 --- a/lib/Perl/Tidy/VerticalAligner/Line.pm +++ b/lib/Perl/Tidy/VerticalAligner/Line.pm @@ -8,7 +8,7 @@ package Perl::Tidy::VerticalAligner::Line; use strict; use warnings; -our $VERSION = '20211029.04'; +our $VERSION = '20211029.05'; BEGIN {