bump version number by .01 20201001.01
authorSteve Hancock <perltidy@users.sourceforge.net>
Fri, 9 Oct 2020 14:14:21 +0000 (07:14 -0700)
committerSteve Hancock <perltidy@users.sourceforge.net>
Fri, 9 Oct 2020 14:14:21 +0000 (07:14 -0700)
25 files changed:
CHANGES.md
bin/perltidy
docs/BugLog.html
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 41c98d9408a7d75b51fe412b6b35a6f51d2b1754..60e04b7cd8d5d13cec76535b98db6b0d8172dd56 100644 (file)
@@ -1,7 +1,11 @@
 # Perltidy Change Log
 
+## 2020 10 01.01
+
     - Add flag -xci, --extended-continuation-indentation, regarding issue git #28
 
+    - Fix issue git #42, clarify how --break-at-old-logical-breakpoints works.
+
     - Fix issue git #41, typo in manual regarding -fsb
 
     - Fix issue git #40: when using the -bli option, a closing brace followed by 
index 4d2bebff6c3d4a748f4e122b65d994e1cd81a05f..13d56ffc8dee1e9a64a05705915ae50670ad2c84 100755 (executable)
@@ -731,21 +731,23 @@ number of spaces assigned to a full indentation level on the B<-i=n> command, or
 
 =item B<-xci>, B<--extended-continuation-indentation>
 
-This flag causes continuation indentation to "extend" deeper into containers.
-It is a fairly recent addition and is set off by default to avoid disturbing
-existing formatting.  If you use a continuation indentation equal to the
-indentation, you will probably want to set this flag.  
+This flag causes continuation indentation to "extend" deeper into structures.
+If you use B<-ci=n> and B<-i=n> with the same value of B<n> you will probably
+want to set this flag.  Since this is a fairly new flag, the default is B<-nxci> 
+to avoid disturbing existing formatting.  
 
 Here is an explanation. There are two common strategies for continuation
 indentation.  One is the strategy recommend in the original perl style
 guidelines, in which B<-ci=2> and B<-i=4>.  The other is the strategy is the
-strategy recommended in the Perl Best Practices (B<-pbp>) by Conway, in which
-B<-ci=4> and B<-i=4>.  The default formatting in perltidy works fairly well
-with the orignal perl style, but problems arise when B<-ci> and B<-i> are given
-equal values as in the B<pbp> style, particularly with ternary statements.  The
-B<-xci> flag was added to fix this.
+strategy recommended for example in the "Perl Best Practices" book by Conway,
+in which B<-ci=4> and B<-i=4>.  The default formatting in perltidy works fairly
+well with the orignal perl style, but problems arise when B<-ci> and B<-i> are
+given equal values as in the B<pbp> style, particularly with ternary
+statements.  The B<-xci> flag was added to fix this.  It may be used with
+any value of B<-ci> but is particularly helpful when B<-ci> and B<-i> are given
+similar values.
 
-For an illustration, please see the section on the B<--perl-best-practices> flag.
+For an illustration, please see the section L<"B<-pbp>, B<--perl-best-practices>">.
 
 =item B<-sil=n> B<--starting-indentation-level=n>   
 
@@ -4350,7 +4352,7 @@ The perltidy binary uses the Perl::Tidy module and is installed when that module
 
 =head1 VERSION
 
-This man page documents perltidy version 20201001
+This man page documents perltidy version 20201001.01
 
 =head1 BUG REPORTS
 
index 476bbf36fe34bf371c04e82a595c01a5b44fc8a7..36cb81fbb81e5b4ef018b1a50fbfffb7115ba8d1 100644 (file)
 
 
 <ul id="index">
+  <li><a href="#Issues-fixed-after-release-20201001">Issues fixed after release 20201001</a></li>
   <li><a href="#Issues-fixed-after-release-20200907">Issues fixed after release 20200907</a></li>
+  <li><a href="#POD-ERRORS">POD ERRORS</a></li>
 </ul>
 
+<h1 id="Issues-fixed-after-release-20201001">Issues fixed after release 20201001</h1>
+
+<dl>
+
+<dt id="terminal-braces-not-indenting-correctly-with--bli-formatting-issue-git-40"><b>terminal braces not indenting correctly with -bli formatting, issue git #40</b></dt>
+<dd>
+
+<p>This problem is illustrated with the following snippet when run with -bli -blil=&#39;*&#39;</p>
+
+<pre><code>    #-bli -bli list=&#39;*&#39;
+    try
+      {
+        die;
+      }
+    catch
+      {
+        die;
+      };    # &lt;-- this was not indenting</code></pre>
+
+<p>This was due to conflicting rules and was fixed 1 Oct 2020 in commit &#39;fix issue git #40, incorrect closing brace indentation with -bli&#39;, a5aefe9.</p>
+
+<p>At the same time, it was noted that block types sort/map/grep and eval were not following -bli formatting when -blil=&#39;*&#39; and this was fixed. For example, with corrected formatting, we would have</p>
+
+<pre><code>  # perltidy -bli -blil=&#39;*&#39;
+    eval
+      {
+        my $app = App::perlbrew-&gt;new( &quot;install-patchperl&quot;, &quot;-q&quot; );
+        $app-&gt;run();
+      }
+      or do
+      {
+        $error          = $@;
+        $produced_error = 1;
+      };</code></pre>
+
+</dd>
+</dl>
+
 <h1 id="Issues-fixed-after-release-20200907">Issues fixed after release 20200907</h1>
 
 <p>This is a detailed log of changes since the release 20200907. All bugs were found with the help of automated random testing.</p>
 </dd>
 </dl>
 
+<h1 id="POD-ERRORS">POD ERRORS</h1>
+
+<p>Hey! <b>The above document had some coding errors, which are explained below:</b></p>
+
+<dl>
+
+<dt id="Around-line-3">Around line 3:</dt>
+<dd>
+
+<p>&#39;=item&#39; outside of any &#39;=over&#39;</p>
+
+</dd>
+<dt id="Around-line-36">Around line 36:</dt>
+<dd>
+
+<p>You forgot a &#39;=back&#39; before &#39;=head1&#39;</p>
+
+</dd>
+</dl>
+
 
 </body>
 
index 1322e7affdffd2d431471754c515092406f21ee1..35e1ab06ff4c321183bfd01083933c334cc7d8b7 100644 (file)
@@ -1,5 +1,17 @@
 <h1>Perltidy Change Log</h1>
 
+<h2>2020 10 01.01</h2>
+
+<pre><code>- Add flag -xci, --extended-continuation-indentation, regarding issue git #28
+
+- Fix issue git #42, clarify how --break-at-old-logical-breakpoints works.
+
+- Fix issue git #41, typo in manual regarding -fsb
+
+- Fix issue git #40: when using the -bli option, a closing brace followed by 
+  a semicolon was not being indented.
+</code></pre>
+
 <h2>2020 10 01</h2>
 
 <pre><code>- Robustness of perltidy has been significantly improved.  Updating is recommended. Continual 
index d484ed589341af2dea58ff0598c98564601e9eab..993d8d7fd7e286f8692a570bfd83716ac59bc9ab 100644 (file)
 
 <h1 id="VERSION">VERSION</h1>
 
-<p>This man page documents Perl::Tidy version 20201001</p>
+<p>This man page documents Perl::Tidy version 20201001.01</p>
 
 <h1 id="LICENSE">LICENSE</h1>
 
index 95d6455cac6c474ad6d354602eb64890b27eaedb..f87b0795650d3265db2d0d021c90955a9e2f96c8 100644 (file)
 
 <p>The value given to <b>-ci</b> is also used by some commands when a small space is required. Examples are commands for outdenting labels, <b>-ola</b>, and control keywords, <b>-okw</b>.</p>
 
-<p>When default values are not used, it is highly recommended that the value <b>n</b> given with <b>-ci=n</b> be no more than about one-half of the number of spaces assigned to a full indentation level on the <b>-i=n</b> command. The reason is that discontinuities in the definition and control of continuation indentation arise in complex code, and this rule helps to smooth out these discontinuities.</p>
+<p>When default values are not used, it is recommended that either</p>
+
+<p>(1) the value <b>n</b> given with <b>-ci=n</b> be no more than about one-half of the number of spaces assigned to a full indentation level on the <b>-i=n</b> command, or</p>
+
+<p>(2) the flag <b>-extended-continuation-indentation</b> is used (see next section).</p>
+
+</dd>
+<dt id="xci---extended-continuation-indentation"><b>-xci</b>, <b>--extended-continuation-indentation</b></dt>
+<dd>
+
+<p>This flag causes continuation indentation to &quot;extend&quot; deeper into structures. If you use <b>-ci=n</b> and <b>-i=n</b> with the same value of <b>n</b> you will probably want to set this flag. Since this is a fairly new flag, the default is <b>-nxci</b> to avoid disturbing existing formatting.</p>
+
+<p>Here is an explanation. There are two common strategies for continuation indentation. One is the strategy recommend in the original perl style guidelines, in which <b>-ci=2</b> and <b>-i=4</b>. The other is the strategy is the strategy recommended for example in the &quot;Perl Best Practices&quot; book by Conway, in which <b>-ci=4</b> and <b>-i=4</b>. The default formatting in perltidy works fairly well with the orignal perl style, but problems arise when <b>-ci</b> and <b>-i</b> are given equal values as in the <b>pbp</b> style, particularly with ternary statements. The <b>-xci</b> flag was added to fix this. It may be used with any value of <b>-ci</b> but is particularly helpful when <b>-ci</b> and <b>-i</b> are given similar values.</p>
+
+<p>For an illustration, please see the section <a href="#pbp---perl-best-practices">&quot;<b>-pbp</b>, <b>--perl-best-practices</b>&quot;</a>.</p>
 
 </dd>
 <dt id="sil-n---starting-indentation-level-n"><b>-sil=n</b> <b>--starting-indentation-level=n</b></dt>
 <pre><code>  # perltidy -nwrs=&#39;-&#39;
   my @newkeys = map $_ -$nrecs + @data, @oldkeys;</code></pre>
 
+<p>For another example, the following two lines will be parsed without syntax error:</p>
+
+<pre><code>  # original programming, syntax ok
+  for my $severity ( reverse $SEVERITY_LOWEST+1 .. $SEVERITY_HIGHEST ) { ...  }
+
+  # perltidy default, syntax ok
+  for my $severity ( reverse $SEVERITY_LOWEST + 1 .. $SEVERITY_HIGHEST ) { ... }</code></pre>
+
+<p>But the following will give a syntax error:</p>
+
+<pre><code>  # perltidy -nwrs=&#39;+&#39;, syntax error:
+  for my $severity ( reverse $SEVERITY_LOWEST +1 .. $SEVERITY_HIGHEST ) { ... }</code></pre>
+
+<p>To avoid subtle parsing problems like this, it is best to avoid spacing a binary operator asymetrically with a space on the left but not on the right.</p>
+
 </dd>
 <dt id="Space-between-specific-keywords-and-opening-paren">Space between specific keywords and opening paren</dt>
 <dd>
 
 <p>The reason this is not recommended is that spacing a function paren can make a program vulnerable to parsing problems by Perl. For example, the following two-line program will run as written but will have a syntax error if reformatted with -sfp:</p>
 
-<pre><code>  if ( -e filename() ) { print &quot;exists\n&quot;; }
+<pre><code>  if ( -e filename() ) { print &quot;I&#39;m here\n&quot;; }
   sub filename { return $0 }</code></pre>
 
-<p>The syntax error can be removed if the line order is reversed, so that Perl parses &#39;sub filename&#39; first.</p>
+<p>In this particular case the syntax error can be removed if the line order is reversed, so that Perl parses &#39;sub filename&#39; first.</p>
 
 </dd>
 <dt id="spp-n-or---space-prototype-paren-n"><b>-spp=n</b> or <b>--space-prototype-paren=n</b></dt>
 <dt id="fse-string---format-skipping-end-string"><b>-fse=string</b>, <b>--format-skipping-end=string</b></dt>
 <dd>
 
-<p>The <b>-fsb=string</b> is the corresponding parameter used to change the ending marker for format skipping. The default is equivalent to -fse=&#39;#&lt;&lt;&lt;&#39;.</p>
+<p>The <b>-fse=string</b> is the corresponding parameter used to change the ending marker for format skipping. The default is equivalent to -fse=&#39;#&lt;&lt;&lt;&#39;.</p>
 
 <p>The beginning and ending strings may be the same, but it is preferable to make them different for clarity.</p>
 
 
 <p>By default, if a logical expression is broken at a <code>&amp;&amp;</code>, <code>||</code>, <code>and</code>, or <code>or</code>, then the container will remain broken. Also, breaks at internal keywords <code>if</code> and <code>unless</code> will normally be retained. To prevent this, and thus form longer lines, use <b>-nbol</b>.</p>
 
+<p>Please note that this flag does not duplicate old logical breakpoints. They are merely used as a hint with this flag that a statement should remain broken. Without this flag, perltidy will normally try to combine relatively short expressions into a single line.</p>
+
+<p>For example, given this snippet:</p>
+
+<pre><code>    return unless $cmd = $cmd || ($dot 
+        &amp;&amp; $Last_Shell) || &amp;prompt(&#39;|&#39;);
+
+    # perltidy -bol [default]
+    return
+      unless $cmd = $cmd
+      || ( $dot
+        &amp;&amp; $Last_Shell )
+      || &amp;prompt(&#39;|&#39;);
+
+    # perltidy -nbol
+    return unless $cmd = $cmd || ( $dot &amp;&amp; $Last_Shell ) || &amp;prompt(&#39;|&#39;);</code></pre>
+
 </dd>
 <dt id="bom---break-at-old-method-breakpoints"><b>-bom</b>, <b>--break-at-old-method-breakpoints</b></dt>
 <dd>
 
 <p>Please note that this parameter set includes -st and -se flags, which make perltidy act as a filter on one file only. These can be overridden by placing <b>-nst</b> and/or <b>-nse</b> after the -pbp parameter.</p>
 
-<p>Also note that the value of continuation indentation, -ci=4, is equal to the value of the full indentation, -i=4. In some complex statements perltidy will produce nicer results with -ci=2. This can be implemented by including -ci=2 after the -pbp parameter. For example,</p>
+<p>Also note that the value of continuation indentation, -ci=4, is equal to the value of the full indentation, -i=4. It is recommended that the either (1) the parameter <b>-ci=2</b> be used instead, or the flag <b>-xci</b> be set. This will help show structure, particularly when there are ternary statements. The following snippet illustrates these options.</p>
 
 <pre><code>    # perltidy -pbp
     $self-&gt;{_text} = (
         $page
         ? ( $section ? &#39; in &#39; : &#39;&#39; ) . &quot;the $page$page_ext manpage&quot;
         : &#39; elsewhere in this document&#39;
-      );</code></pre>
+      );
+
+    # perltidy -pbp -xci
+    $self-&gt;{_text} = (
+         !$section        ? &#39;&#39;
+        : $type eq &#39;item&#39; ? &quot;the $section entry&quot;
+        :                   &quot;the section on $section&quot;
+        )
+        . ( $page
+            ? ( $section ? &#39; in &#39; : &#39;&#39; ) . &quot;the $page$page_ext manpage&quot;
+            : &#39; elsewhere in this document&#39;
+        );</code></pre>
+
+<p>The <b>-xci</b> flag was developed after the <b>-pbp</b> parameters were published so you need to include it separately.</p>
 
 </dd>
 <dt id="One-line-blocks">One-line blocks</dt>
 
 <p>There are a few points to note regarding one-line blocks. A one-line block is something like this,</p>
 
-<pre><code>        if ($x &gt; 0) { $y = 1 / $x }  </code></pre>
-
 <p>where the contents within the curly braces is short enough to fit on a single line.</p>
 
 <p>With few exceptions, perltidy retains existing one-line blocks, if it is possible within the line-length constraint, but it does not attempt to form new ones. In other words, perltidy will try to follow the one-line block style of the input file.</p>
 
 <h1 id="VERSION">VERSION</h1>
 
-<p>This man page documents perltidy version 20201001</p>
+<p>This man page documents perltidy version 20201001.01</p>
 
 <h1 id="BUG-REPORTS">BUG REPORTS</h1>
 
index a77d25c24d67b406833501f29d28c366b10fe6c8..acff7509045b0879402ba0f1410fb285e01046bc 100644 (file)
@@ -107,7 +107,7 @@ BEGIN {
     # Release version must be bumped, and it is probably past time for a
     # release anyway.
 
-    $VERSION = '20201001';
+    $VERSION = '20201001.01';
 }
 
 sub DESTROY {
index 922766b116902e1ba945fc1d39e2c9a447690772..7365238b5c75f3492705bbfb0e7080c6b7ba1dc7 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 20201001
+This man page documents Perl::Tidy version 20201001.01
 
 =head1 LICENSE
 
index 96ad3f3f362405a9d4182308a3e8272faaaee569..3362de598104915fd28982be98a4657e9766ae22 100644 (file)
@@ -7,7 +7,7 @@
 package Perl::Tidy::Debugger;
 use strict;
 use warnings;
-our $VERSION = '20201001';
+our $VERSION = '20201001.01';
 
 sub new {
 
index 19dab0971a5fa6073d56e5924cc7a156e87f0904..a17fe9741dd693d1f50a8ef53f8bbc3fe40e1df5 100644 (file)
@@ -7,7 +7,7 @@
 package Perl::Tidy::DevNull;
 use strict;
 use warnings;
-our $VERSION = '20201001';
+our $VERSION = '20201001.01';
 sub new   { my $self = shift; return bless {}, $self }
 sub print { return }
 sub close { return }
index 718daf65f9f4902bb455be90698eb51328f8ce4b..901d33c26f452f7bceefbfa14c9f845674b32325 100644 (file)
@@ -20,7 +20,7 @@
 package Perl::Tidy::Diagnostics;
 use strict;
 use warnings;
-our $VERSION = '20201001';
+our $VERSION = '20201001.01';
 
 sub AUTOLOAD {
 
index fa3e23f99eb5d6a5bcbccd56883778c84c764890..647ac4ec535c01590633362f0694381eaeae26cb 100644 (file)
@@ -7,7 +7,7 @@
 package Perl::Tidy::FileWriter;
 use strict;
 use warnings;
-our $VERSION = '20201001';
+our $VERSION = '20201001.01';
 
 sub AUTOLOAD {
 
index 21405861e0503ff8684284b47199af9bbff3d276..d0e9fa8cdf58156257fefd03f7eadeb8cd0e73da 100644 (file)
@@ -49,7 +49,7 @@ use constant DEVEL_MODE => 0;
 { #<<< A non-indenting brace to contain all lexical variables
 
 use Carp;
-our $VERSION = '20201001';
+our $VERSION = '20201001.01';
 
 # The Tokenizer will be loaded with the Formatter
 ##use Perl::Tidy::Tokenizer;    # for is_keyword()
index f59f27185817f20a0df0b8fb77861c52f002f2aa..2fe50ad88e11f7b61007ac1a5e51b318c6afaf95 100644 (file)
@@ -7,7 +7,7 @@
 package Perl::Tidy::HtmlWriter;
 use strict;
 use warnings;
-our $VERSION = '20201001';
+our $VERSION = '20201001.01';
 
 use File::Basename;
 
index 70154271300614db3ced96fc58d0cc634e0329af..874c57ab5d52e14f44aa9754969b70ec3d559428 100644 (file)
@@ -10,7 +10,7 @@ package Perl::Tidy::IOScalar;
 use strict;
 use warnings;
 use Carp;
-our $VERSION = '20201001';
+our $VERSION = '20201001.01';
 
 sub AUTOLOAD {
 
index 66d28d5aab7fd7bcfd26eb8074c92100f231e634..df23191732449b17955c6e79af26f4de4657df9b 100644 (file)
@@ -14,7 +14,7 @@ package Perl::Tidy::IOScalarArray;
 use strict;
 use warnings;
 use Carp;
-our $VERSION = '20201001';
+our $VERSION = '20201001.01';
 
 sub AUTOLOAD {
 
index 4c2bd199d63d7e61845deb4dee56d8df1bef3cc4..85e77c02c2448814df61ec4268ef264346527e78 100644 (file)
@@ -8,7 +8,7 @@
 package Perl::Tidy::IndentationItem;
 use strict;
 use warnings;
-our $VERSION = '20201001';
+our $VERSION = '20201001.01';
 
 BEGIN {
 
index af2476a9693cc69b6ac6aa69620136404897f554..bb5ebdd0daaf969cbdcf49caea3549d5e8c45121 100644 (file)
@@ -12,7 +12,7 @@
 package Perl::Tidy::LineBuffer;
 use strict;
 use warnings;
-our $VERSION = '20201001';
+our $VERSION = '20201001.01';
 
 sub AUTOLOAD {
 
index 71794f8183cfebd75a76bf2ffb3022c9168b1d86..6c701d872c8aee3881253c8b34a214faf05c638c 100644 (file)
@@ -8,7 +8,7 @@
 package Perl::Tidy::LineSink;
 use strict;
 use warnings;
-our $VERSION = '20201001';
+our $VERSION = '20201001.01';
 
 sub AUTOLOAD {
 
index faf71a0dac5a3bf93a944ae35d09ef24290a759a..43b605fff48c620e5664ba7fc787ab230bc0df87 100644 (file)
@@ -8,7 +8,7 @@
 package Perl::Tidy::LineSource;
 use strict;
 use warnings;
-our $VERSION = '20201001';
+our $VERSION = '20201001.01';
 
 sub AUTOLOAD {
 
index ac9c3772197d432ad65ee2be27ba634e71ad3375..fbbbfc84c1f39bb6cd98f2d585e421cce64e84f3 100644 (file)
@@ -7,7 +7,7 @@
 package Perl::Tidy::Logger;
 use strict;
 use warnings;
-our $VERSION = '20201001';
+our $VERSION = '20201001.01';
 
 sub AUTOLOAD {
 
index 27ceee9f28cd53ed94c0d6e1fd7f1b919d72e713..ab13c6ee1365dc7a31cc16b8781941b040d5882b 100644 (file)
@@ -21,7 +21,7 @@
 package Perl::Tidy::Tokenizer;
 use strict;
 use warnings;
-our $VERSION = '20201001';
+our $VERSION = '20201001.01';
 
 use Perl::Tidy::LineBuffer;
 use Carp;
index 55c3fa96e1c73e40d2a56ad5142297f2226b3a94..56dbeb8abc1620f8bf0866fbe01d8b0205ec9b77 100644 (file)
@@ -1,7 +1,7 @@
 package Perl::Tidy::VerticalAligner;
 use strict;
 use warnings;
-our $VERSION = '20201001';
+our $VERSION = '20201001.01';
 
 use Perl::Tidy::VerticalAligner::Alignment;
 use Perl::Tidy::VerticalAligner::Line;
index 8e34b14390008332341bcdd5d44142441a78e2d5..3d79829f3a5b5c6d265637d95a881dfd4c90b2c1 100644 (file)
@@ -10,7 +10,7 @@ use warnings;
 
 { #<<< A non-indenting brace
 
-our $VERSION = '20201001';
+our $VERSION = '20201001.01';
 
 #    _column_          # the current column number
 #    _starting_column_ # column number when created
index f0cfae937365760e6f577492ce30f746616138be..f35ecf3bf01d75947f3197fcd6cffa33090a4791 100644 (file)
@@ -8,7 +8,7 @@
 package Perl::Tidy::VerticalAligner::Line;
 use strict;
 use warnings;
-our $VERSION = '20201001';
+our $VERSION = '20201001.01';
 
 BEGIN {
     my $i = 0;