]> git.donarmstrong.com Git - perltidy.git/commitdiff
bump version to 20211029.05 20211029.05
authorSteve Hancock <perltidy@users.sourceforge.net>
Tue, 4 Jan 2022 15:09:42 +0000 (07:09 -0800)
committerSteve Hancock <perltidy@users.sourceforge.net>
Tue, 4 Jan 2022 15:09:42 +0000 (07:09 -0800)
24 files changed:
CHANGES.md
bin/perltidy
docs/ChangeLog.html
docs/Tidy.html
docs/perltidy.html
lib/Perl/Tidy.pm
lib/Perl/Tidy.pod
lib/Perl/Tidy/Debugger.pm
lib/Perl/Tidy/DevNull.pm
lib/Perl/Tidy/Diagnostics.pm
lib/Perl/Tidy/FileWriter.pm
lib/Perl/Tidy/Formatter.pm
lib/Perl/Tidy/HtmlWriter.pm
lib/Perl/Tidy/IOScalar.pm
lib/Perl/Tidy/IOScalarArray.pm
lib/Perl/Tidy/IndentationItem.pm
lib/Perl/Tidy/LineBuffer.pm
lib/Perl/Tidy/LineSink.pm
lib/Perl/Tidy/LineSource.pm
lib/Perl/Tidy/Logger.pm
lib/Perl/Tidy/Tokenizer.pm
lib/Perl/Tidy/VerticalAligner.pm
lib/Perl/Tidy/VerticalAligner/Alignment.pm
lib/Perl/Tidy/VerticalAligner/Line.pm

index 2381365ae5871d0924bda63fc67cff7445b1b558..9ac5a6f9351092641db41e1b9e45fb0c2150dd1e 100644 (file)
@@ -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).
index 54634a54ff150f12c564cd54ac94924b57cd28ac..6781835d88a194c038a4c4aa47e52427eb413f4e 100755 (executable)
@@ -4188,20 +4188,19 @@ alignment will not occur if B<-nvbc> is set.  The default is B<-vbc>.
 
 =item B<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 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<valign-exclusion-list=s>.  For example, the following would prevent alignment at B<=> and B<if>:
+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<valign-exclusion-list=s>.  For example, the following would prevent alignment at B<=> and B<if>:
 
   --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
 
index 51cd83f2a9b6c58345f1502302cdd6e118af788a..8868e14398c84a9593013a915f82fe82101a9985 100644 (file)
@@ -1,8 +1,12 @@
 <h1>Perltidy Change Log</h1>
 
-<h2>2021 10 29.04</h2>
+<h2>2021 10 29.05</h2>
 
-<pre><code>- A new flag -gal=s, --grep-alias-list=s, has been added as suggested in
+<pre><code>- 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:
index f758315652ca2b0df5a56cff5237a8379a6e1b0c..6b001c226d6e2480d6691eab7bf59bfe699afd38 100644 (file)
 
 <h1 id="VERSION">VERSION</h1>
 
-<p>This man page documents Perl::Tidy version 20211029.04</p>
+<p>This man page documents Perl::Tidy version 20211029.05</p>
 
 <h1 id="LICENSE">LICENSE</h1>
 
index f9d99d7d69181604db0291dd544041a78d88b444..7bf8970d186d887847725beb189fb825f9a1defb 100644 (file)
 <dt id="Controlling-code-alignment-with---valign-code-or--vc"><b>Controlling code alignment with --valign-code or -vc</b></dt>
 <dd>
 
-<p>The <b>-vc</b> flag enables alignment of code symbols such as <b>=</b>. The default is <b>-vc</b>.</p>
+<p>The <b>-vc</b> flag enables alignment of code symbols such as <b>=</b>. The default is <b>-vc</b>. For detailed control of which symbols to align, see the <b>-valign-exclude-list</b> parameter below.</p>
 
 </dd>
 <dt id="Controlling-side-comment-alignment-with---valign-side-comments-or--vsc"><b>Controlling side comment alignment with --valign-side-comments or -vsc</b></dt>
 
 <p>When <b>-vbc</b> 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 <b>-nvbc</b> is set. The default is <b>-vbc</b>.</p>
 
+</dd>
+<dt id="Finer-alignment-control-with---valign-exclusion-list-s-or--vxl-s-and---valign-inclusion-list-s-or--vil-s"><b>Finer alignment control with --valign-exclusion-list=s or -vxl=s and --valign-inclusion-list=s or -vil=s</b></dt>
+<dd>
+
+<p>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 &#39;,&#39;, &#39;=&#39;, and &#39;=&gt;&#39;, but many other alignments are possible and are given in the following list:</p>
+
+<pre><code>  = **= += *= &amp;= &lt;&lt;= &amp;&amp;= -= /= |= &gt;&gt;= ||= //= .= %= ^= x=
+  { ( ? : , ; =&gt; &amp;&amp; || ~~ !~~ =~ !~ // &lt;=&gt; -&gt;
+  if unless and or err for foreach while until</code></pre>
+
+<p>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>valign-exclusion-list=s</b>. For example, the following would prevent alignment at <b>=</b> and <b>if</b>:</p>
+
+<pre><code>  --valign-exclusion-list=&#39;= if&#39;</code></pre>
+
+<p>If it is simpler to specify only the token types which are to be aligned, then use the special symbol <b>*</b> for this exclusion list and include the types which are to be aligned in the list of <b>--valign-inclusion-list</b> (this works because <b>*</b> is not one of the alignment tokens). For example, the following parameters enable alignment only at commas and &#39;fat commas&#39;:</p>
+
+<pre><code>  --valign-exclusion-list=&#39;*&#39;
+  --valign-inclusion-list=&#39;, =&gt;&#39;</code></pre>
+
+<p>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.</p>
+
+<p>The default values of these parameters enable all alignments and are equivalent to</p>
+
+<pre><code>  --valign-exclusion-list=&#39; &#39;
+  --valign-inclusion-list=&#39;*&#39;</code></pre>
+
+<p>To illustrate, consider the following snippet with default formatting</p>
+
+<pre><code>    # perltidy
+    $co_description = ($color) ? &#39;bold cyan&#39;  : &#39;&#39;;           # description
+    $co_prompt      = ($color) ? &#39;bold green&#39; : &#39;&#39;;           # prompt
+    $co_unused      = ($color) ? &#39;on_green&#39;   : &#39;reverse&#39;;    # unused</code></pre>
+
+<p>To exclude all alignments except the equals we could use:</p>
+
+<pre><code>    # perltidy -vxl=&#39;*&#39; -vil=&#39;=&#39;
+    $co_description = ($color) ? &#39;bold cyan&#39; : &#39;&#39;;          # description
+    $co_prompt      = ($color) ? &#39;bold green&#39; : &#39;&#39;;         # prompt
+    $co_unused      = ($color) ? &#39;on_green&#39; : &#39;reverse&#39;;    # unused</code></pre>
+
+<p>To exclude only the equals we could use:</p>
+
+<pre><code>    # perltidy -vxl=&#39;=&#39;
+    $co_description = ($color) ? &#39;bold cyan&#39; : &#39;&#39;;     # description
+    $co_prompt = ($color) ? &#39;bold green&#39; : &#39;&#39;;         # prompt
+    $co_unused = ($color) ? &#39;on_green&#39; : &#39;reverse&#39;;    # unused</code></pre>
+
+<p>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.</p>
+
+<p>But also notice that side comments remain aligned because their alignment is controlled separately with the parameter <b>--valign-side_comments</b> described above.</p>
+
 </dd>
 </dl>
 
 
 <h1 id="VERSION">VERSION</h1>
 
-<p>This man page documents perltidy version 20211029.04</p>
+<p>This man page documents perltidy version 20211029.05</p>
 
 <h1 id="BUG-REPORTS">BUG REPORTS</h1>
 
index dbdfcf05f49b6f2517819e7cbb3f279b17152be0..53b6e29c742176e37a7daab6a1d7d7e1eb6dfdb0 100644 (file)
@@ -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 {
index 7e9509ff2baac81d73b8c02f40c40a32355d5e02..aaaf72a34ae2648df6a13038676de6a86a71aecd 100644 (file)
@@ -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
 
index 123fac898cee90ba3f6dee6e056f9e6d7175e8b4..2e0bfe80749fd360607e228f7324f04d503b387e 100644 (file)
@@ -7,7 +7,7 @@
 package Perl::Tidy::Debugger;
 use strict;
 use warnings;
-our $VERSION = '20211029.04';
+our $VERSION = '20211029.05';
 
 sub new {
 
index 0c0506e77f2e32cb6f106407b12f294cb7851398..95eff269625bf224da864d6668713e511c6093f4 100644 (file)
@@ -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 }
index d01406f2235d3d8c1c2238eb09b0e2c8055c2c8f..4ad6a10e7d0a4e58a176185d43848e145fd9817f 100644 (file)
@@ -20,7 +20,7 @@
 package Perl::Tidy::Diagnostics;
 use strict;
 use warnings;
-our $VERSION = '20211029.04';
+our $VERSION = '20211029.05';
 
 sub AUTOLOAD {
 
index 8957f88298256516e844ae7561fe24f1a0b49f62..d036935ff430417d6925a259652fc860559a3b67 100644 (file)
@@ -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;
 
index f1cb62a43be89e1854496f3399d4b5a1cc0b59a3..63f66a84f8071cc8caab1e4a3da12b595dfadbd6 100644 (file)
@@ -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()
index e5e2f15aec3ae243f6747be767b464df53e122f4..ca22b58a8dd49127d0a7599f220474d0c7d17682 100644 (file)
@@ -7,7 +7,7 @@
 package Perl::Tidy::HtmlWriter;
 use strict;
 use warnings;
-our $VERSION = '20211029.04';
+our $VERSION = '20211029.05';
 
 use File::Basename;
 
index baa2e4b6f0997add18fd288d564626d1c3f3a878..9793c5d2da950f7b73ab7425534751c3f56a8156 100644 (file)
@@ -10,7 +10,7 @@ package Perl::Tidy::IOScalar;
 use strict;
 use warnings;
 use Carp;
-our $VERSION = '20211029.04';
+our $VERSION = '20211029.05';
 
 sub AUTOLOAD {
 
index aff25afbe3cc34806af8b081ef8144f12275b49c..d139ea1a986efa80d5601d93def99e5bdbc3728c 100644 (file)
@@ -14,7 +14,7 @@ package Perl::Tidy::IOScalarArray;
 use strict;
 use warnings;
 use Carp;
-our $VERSION = '20211029.04';
+our $VERSION = '20211029.05';
 
 sub AUTOLOAD {
 
index feaba4b0ab90bbc19b7474feb2b55a03ffd177af..310ce4b03bd0700325234a40a6fe3805f86a09c6 100644 (file)
@@ -8,7 +8,7 @@
 package Perl::Tidy::IndentationItem;
 use strict;
 use warnings;
-our $VERSION = '20211029.04';
+our $VERSION = '20211029.05';
 
 BEGIN {
 
index 4ae4db42f1ecc0390ee3ae50010dcb08f2b304fa..b6080288a2640762702505b995c414a0e5cbe348 100644 (file)
@@ -12,7 +12,7 @@
 package Perl::Tidy::LineBuffer;
 use strict;
 use warnings;
-our $VERSION = '20211029.04';
+our $VERSION = '20211029.05';
 
 sub AUTOLOAD {
 
index f2794524a12940f28cafe4d20af3248dd1b4061a..4172a307203d81b2c56fac086829f3b80d5ea35f 100644 (file)
@@ -8,7 +8,7 @@
 package Perl::Tidy::LineSink;
 use strict;
 use warnings;
-our $VERSION = '20211029.04';
+our $VERSION = '20211029.05';
 
 sub AUTOLOAD {
 
index 667491468007efc2e67bfa7a937d26d5383fa652..c663fc0f47fd04488b591b6c9a81e49fd6e09599 100644 (file)
@@ -8,7 +8,7 @@
 package Perl::Tidy::LineSource;
 use strict;
 use warnings;
-our $VERSION = '20211029.04';
+our $VERSION = '20211029.05';
 
 sub AUTOLOAD {
 
index 7b852ebd9a78561e9fc9eb026195bb3fa3305df3..e459b4ed2701227714685e7b935498e89c936994 100644 (file)
@@ -7,7 +7,7 @@
 package Perl::Tidy::Logger;
 use strict;
 use warnings;
-our $VERSION = '20211029.04';
+our $VERSION = '20211029.05';
 
 sub AUTOLOAD {
 
index 8ef912ed69a17eae78547399b82acd3d6a4777ca..90dce9d04a343436efbfc65e4c70c714636b3124 100644 (file)
@@ -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;
index 3da02ef5e02bcc99a89358596396c0f800a1853c..2eb1e6cbf43081c75d4b2a3ea33d0aa614e08045 100644 (file)
@@ -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;
 
index e67c09c55fb7022bc158abe51095498c3e50936d..0a548eff13ca55ff196d9ab043880b05a1c96f76 100644 (file)
@@ -10,7 +10,7 @@ use warnings;
 
 { #<<< A non-indenting brace
 
-our $VERSION = '20211029.04';
+our $VERSION = '20211029.05';
 
 BEGIN {
 
index 8a236ff970db20149f99db8ba3bdeec799b482fb..d90e7221d6e598c4fcd289cbc061996288dae177 100644 (file)
@@ -8,7 +8,7 @@
 package Perl::Tidy::VerticalAligner::Line;
 use strict;
 use warnings;
-our $VERSION = '20211029.04';
+our $VERSION = '20211029.05';
 
 BEGIN {