Perl-Tidy

 view release on metacpan or  search on metacpan

docs/BugLog.html  view on Meta::CPAN

    SIG
    PROG</code></pre>

<p>25 May 2021, 6947fe9.</p>

</dd>
<dt id="Modify-welding-rules"><b>Modify welding rules</b></dt>
<dd>

<p>This is an update to the patch 19 Apr 2021, eeeaf09. It restricts that patch to -lp formatting mode.</p>

<p>This fixes case b1131.</p>

<p>21 May 2021, a4ec4c1.</p>

</dd>
<dt id="Fix-inconsistency-involving-counting-commas"><b>Fix inconsistency involving counting commas</b></dt>
<dd>

<p>Random testing produced a formatting instability involving the combination of flags -bbp=2 -xci -vt=2 -bvtc=2. The problem was traced to an error in counting the number of line ending commas in lists.</p>

<p>This fixes case b1130.</p>

<p>15 May 2021, 90cceb1.</p>

</dd>
<dt id="Slightly-modify-line-breaks-for--lp-indentation"><b>Slightly modify line breaks for -lp indentation</b></dt>
<dd>

<p>Random testing produced an edge case of formatting instability for -lp indentation which was traced to checking for an old line break at a &#39;=&gt;&#39;. This has been fixed. Some existing formatting with deeply nested structures may be slightly...

<p>This fixes b1035.</p>

<p>15 May 2021, dd42648.</p>

</dd>
<dt id="Rewrite-coding-for--bom-flag"><b>Rewrite coding for -bom flag</b></dt>
<dd>

<p>Random testing produced some examples of formatting instability involving the -bom flag in combination with certain other flags which are fixed with this update. As part of this update, a previous update to fix case b977 (21 Feb 2021, commit 28114...

<p>Some issues are illustrated in the following examples using &#39;-bom -gnu&#39;. In the first example the leading &#39;)-&gt;&#39; was being lost due to the old b977 fix:</p>

<pre><code>    # input:
    $show = $top-&gt;Entry( &#39;-width&#39; =&gt; 20,
                       )-&gt;pack(&#39;-side&#39; =&gt; &#39;left&#39;);

    # OLD: perltidy -gnu -bom
    $show = $top-&gt;Entry(&#39;-width&#39; =&gt; 20,)-&gt;pack(&#39;-side&#39; =&gt; &#39;left&#39;);

    # NEW: perltidy -gnu -bom
    $show = $top-&gt;Entry(
                        &#39;-width&#39; =&gt; 20,
                       )-&gt;pack(&#39;-side&#39; =&gt; &#39;left&#39;);</code></pre>

<p>In the following example a leading &#39;-&gt;&#39; was being lost. The NEW version keeps the leading &#39;-&gt;&#39; but has to give up on the -lp alignment because of complexity:</p>

<pre><code>        # input
        $_make_phase_arg = join(&quot; &quot;,
                           map {CPAN::HandleConfig
                                 -&gt;safe_quote($_)} @{$prefs-&gt;{$phase}{args}},
                          );

        # OLD: perltidy -gnu -bom
        $_make_phase_arg = join(&quot; &quot;,
                                map { CPAN::HandleConfig-&gt;safe_quote($_) }
                                  @{$prefs-&gt;{$phase}{args}},
                               );

        # NEW: perltidy -gnu -bom
        $_make_phase_arg = join(
            &quot; &quot;,
            map {
                CPAN::HandleConfig
                  -&gt;safe_quote($_)
            } @{$prefs-&gt;{$phase}{args}},
        );</code></pre>

<p>In the following example, a leading &#39;)-&gt;&#39; was being converted to a leading &#39;-&gt;&#39; due to the old b977 fix:</p>

<pre><code>    # Starting script
    $lb = $t-&gt;Scrolled(&quot;Listbox&quot;, -scrollbars =&gt; &quot;osoe&quot;
                      )-&gt;pack(-fill =&gt; &quot;both&quot;, -expand =&gt; 1);

    # OLD: perltidy -bom -gnu
    $lb = $t-&gt;Scrolled( &quot;Listbox&quot;, -scrollbars =&gt; &quot;osoe&quot; )
      -&gt;pack( -fill =&gt; &quot;both&quot;, -expand =&gt; 1 );

    # NEW: perltidy -bom -gnu
    $lb = $t-&gt;Scrolled(
                       &quot;Listbox&quot;, -scrollbars =&gt; &quot;osoe&quot;
                      )-&gt;pack(-fill =&gt; &quot;both&quot;, -expand =&gt; 1);</code></pre>

<p>In the following example, a leading &#39;)-&gt;&#39; was being lost, again due to the old b977 fix:</p>

<pre><code>    $myDiag-&gt;Label(-text =&gt; $text,
                                  )-&gt;pack(-fill =&gt; &#39;x&#39;,
                                                  -padx =&gt; 3,
                                                  -pady =&gt; 3);

    # OLD: -gnu -bom
    $myDiag-&gt;Label(-text =&gt; $text,)-&gt;pack(
                                          -fill =&gt; &#39;x&#39;,
                                          -padx =&gt; 3,
                                          -pady =&gt; 3
                                         );

    # NEW -gnu -bom
    $myDiag-&gt;Label(
                   -text =&gt; $text,
      )-&gt;pack(
              -fill =&gt; &#39;x&#39;,
              -padx =&gt; 3,
              -pady =&gt; 3
             );</code></pre>

<p>This update fixes case b1120 and revises the fix for b977.</p>

<p>13 May 2021, d0ac5e9.</p>

</dd>
<dt id="Adjust-tolerances-for-some-line-length-tests"><b>Adjust tolerances for some line length tests</b></dt>
<dd>

<p>Random testing produced some edge cases of unstable formatting involving the -lp format. These were fixed by using a slightly larger tolerance in the length test for containers which were broken in the input file.</p>

<p>This fixes cases b1059 b1063 b1117.</p>

<p>13 May 2021, 24a11d3.</p>

</dd>
<dt id="Do-not-apply--lp-formatting-to-containers-with-here-doc-text"><b>Do not apply -lp formatting to containers with here-doc text</b></dt>
<dd>

<p>If a container contains text of a here-doc then the indentation is fixed by the here-doc text, so applying -lp formatting does not work well. So this update turns off the -lp formatting in this case.</p>



( run in 0.627 second using v1.01-cache-2.11-cpan-8f98c5d2c55 )