]> git.donarmstrong.com Git - perltidy.git/commitdiff
updated kgb docs
authorSteve Hancock <perltidy@users.sourceforge.net>
Mon, 17 Dec 2018 17:31:22 +0000 (09:31 -0800)
committerSteve Hancock <perltidy@users.sourceforge.net>
Mon, 17 Dec 2018 17:31:22 +0000 (09:31 -0800)
bin/perltidy
docs/perltidy.html
lib/Perl/Tidy/Formatter.pm

index 1529788b5104506494edce67e00e0105ca4dbbf0..a6d837b6a3614f85715d748ff1add97612b16b77 100755 (executable)
@@ -2653,6 +2653,43 @@ lines will be gone.  However, this will cause all old blank lines to be
 ignored, perhaps even some that were added by hand to improve formatting. So
 please be cautious when using these parameters.
 
+=item B<-mbl=n> B<--maximum-consecutive-blank-lines=n>   
+
+This parameter specifies the maximum number of consecutive blank lines which
+will be output within code sections of a script.  The default is n=1.  If the
+input file has more than n consecutive blank lines, the number will be reduced
+to n except as noted above for the B<-blbp> and B<-blbs> parameters.  If B<n=0>
+then no blank lines will be output (unless all old blank lines are retained
+with the B<-kbl=2> flag of the next section).
+
+This flag obviously does not apply to pod sections,
+here-documents, and quotes.  
+
+=item B<-kbl=n>,  B<--keep-old-blank-lines=n>
+
+The B<-kbl=n> flag gives you control over how your existing blank lines are
+treated.  
+
+The possible values of B<n> are:
+
+ n=0 ignore all old blank lines
+ n=1 stable: keep old blanks, but limited by the value of the B<-mbl=n> flag
+ n=2 keep all old blank lines, regardless of the value of the B<-mbl=n> flag
+
+The default is B<n=1>.  
+
+=item B<-sob>,  B<--swallow-optional-blank-lines>
+
+This is equivalent to B<kbl=0> and is included for compatibility with
+previous versions.
+
+=item B<-nsob>,  B<--noswallow-optional-blank-lines>
+
+This is equivalent to B<kbl=1> and is included for compatibility with
+previous versions.
+
+=back
+
 =item B<Controls for blank lines around lines of consecutive keywords>
 
 It is common in Perl programs to have consecutive statements beginning with a
@@ -2827,42 +2864,6 @@ is badly formatted, it would be best to make a first pass without these options.
 
 =back
 
-=item B<-mbl=n> B<--maximum-consecutive-blank-lines=n>   
-
-This parameter specifies the maximum number of consecutive blank lines which
-will be output within code sections of a script.  The default is n=1.  If the
-input file has more than n consecutive blank lines, the number will be reduced
-to n except as noted above for the B<-blbp> and B<-blbs> parameters.  If B<n=0>
-then no blank lines will be output (unless all old blank lines are retained
-with the B<-kbl=2> flag of the next section).
-
-This flag obviously does not apply to pod sections,
-here-documents, and quotes.  
-
-=item B<-kbl=n>,  B<--keep-old-blank-lines=n>
-
-The B<-kbl=n> flag gives you control over how your existing blank lines are
-treated.  
-
-The possible values of B<n> are:
-
- n=0 ignore all old blank lines
- n=1 stable: keep old blanks, but limited by the value of the B<-mbl=n> flag
- n=2 keep all old blank lines, regardless of the value of the B<-mbl=n> flag
-
-The default is B<n=1>.  
-
-=item B<-sob>,  B<--swallow-optional-blank-lines>
-
-This is equivalent to B<kbl=0> and is included for compatibility with
-previous versions.
-
-=item B<-nsob>,  B<--noswallow-optional-blank-lines>
-
-This is equivalent to B<kbl=1> and is included for compatibility with
-previous versions.
-
-=back
 
 =head2 Styles
 
index b835b9b627371f2e0e8d9b9c114d7895faeb6f38..1f6764da6994e82acd4067f292f90247410144d8 100644 (file)
@@ -53,6 +53,7 @@
   <li><a href="#COPYRIGHT">COPYRIGHT</a></li>
   <li><a href="#LICENSE">LICENSE</a></li>
   <li><a href="#DISCLAIMER">DISCLAIMER</a></li>
+  <li><a href="#POD-ERRORS">POD ERRORS</a></li>
 </ul>
 
 <h1 id="NAME">NAME</h1>
 <p>We can easily fix this by telling perltidy to ignore old blank lines by including the added parameter <b>-kbl=0</b> and rerunning. Then the unwanted blank lines will be gone. However, this will cause all old blank lines to be ignored, perhaps even some that were added by hand to improve formatting. So please be cautious when using these parameters.</p>
 
 </dd>
+<dt id="mbl-n---maximum-consecutive-blank-lines-n"><b>-mbl=n</b> <b>--maximum-consecutive-blank-lines=n</b></dt>
+<dd>
+
+<p>This parameter specifies the maximum number of consecutive blank lines which will be output within code sections of a script. The default is n=1. If the input file has more than n consecutive blank lines, the number will be reduced to n except as noted above for the <b>-blbp</b> and <b>-blbs</b> parameters. If <b>n=0</b> then no blank lines will be output (unless all old blank lines are retained with the <b>-kbl=2</b> flag of the next section).</p>
+
+<p>This flag obviously does not apply to pod sections, here-documents, and quotes.</p>
+
+</dd>
+<dt id="kbl-n---keep-old-blank-lines-n"><b>-kbl=n</b>, <b>--keep-old-blank-lines=n</b></dt>
+<dd>
+
+<p>The <b>-kbl=n</b> flag gives you control over how your existing blank lines are treated.</p>
+
+<p>The possible values of <b>n</b> are:</p>
+
+<pre><code> n=0 ignore all old blank lines
+ n=1 stable: keep old blanks, but limited by the value of the B&lt;-mbl=n&gt; flag
+ n=2 keep all old blank lines, regardless of the value of the B&lt;-mbl=n&gt; flag</code></pre>
+
+<p>The default is <b>n=1</b>.</p>
+
+</dd>
+<dt id="sob---swallow-optional-blank-lines"><b>-sob</b>, <b>--swallow-optional-blank-lines</b></dt>
+<dd>
+
+<p>This is equivalent to <b>kbl=0</b> and is included for compatibility with previous versions.</p>
+
+</dd>
+<dt id="nsob---noswallow-optional-blank-lines"><b>-nsob</b>, <b>--noswallow-optional-blank-lines</b></dt>
+<dd>
+
+<p>This is equivalent to <b>kbl=1</b> and is included for compatibility with previous versions.</p>
+
+</dd>
+</dl>
+
+<dl>
+
 <dt id="Controls-for-blank-lines-around-lines-of-consecutive-keywords"><b>Controls for blank lines around lines of consecutive keywords</b></dt>
 <dd>
 
 </li>
 </ul>
 
-</dd>
-<dt id="mbl-n---maximum-consecutive-blank-lines-n"><b>-mbl=n</b> <b>--maximum-consecutive-blank-lines=n</b></dt>
-<dd>
-
-<p>This parameter specifies the maximum number of consecutive blank lines which will be output within code sections of a script. The default is n=1. If the input file has more than n consecutive blank lines, the number will be reduced to n except as noted above for the <b>-blbp</b> and <b>-blbs</b> parameters. If <b>n=0</b> then no blank lines will be output (unless all old blank lines are retained with the <b>-kbl=2</b> flag of the next section).</p>
-
-<p>This flag obviously does not apply to pod sections, here-documents, and quotes.</p>
-
-</dd>
-<dt id="kbl-n---keep-old-blank-lines-n"><b>-kbl=n</b>, <b>--keep-old-blank-lines=n</b></dt>
-<dd>
-
-<p>The <b>-kbl=n</b> flag gives you control over how your existing blank lines are treated.</p>
-
-<p>The possible values of <b>n</b> are:</p>
-
-<pre><code> n=0 ignore all old blank lines
- n=1 stable: keep old blanks, but limited by the value of the B&lt;-mbl=n&gt; flag
- n=2 keep all old blank lines, regardless of the value of the B&lt;-mbl=n&gt; flag</code></pre>
-
-<p>The default is <b>n=1</b>.</p>
-
-</dd>
-<dt id="sob---swallow-optional-blank-lines"><b>-sob</b>, <b>--swallow-optional-blank-lines</b></dt>
-<dd>
-
-<p>This is equivalent to <b>kbl=0</b> and is included for compatibility with previous versions.</p>
-
-</dd>
-<dt id="nsob---noswallow-optional-blank-lines"><b>-nsob</b>, <b>--noswallow-optional-blank-lines</b></dt>
-<dd>
-
-<p>This is equivalent to <b>kbl=1</b> and is included for compatibility with previous versions.</p>
-
 </dd>
 </dl>
 
 
 <p>See the &quot;GNU General Public License&quot; for more details.</p>
 
+<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-2693">Around line 2693:</dt>
+<dd>
+
+<p>&#39;=item&#39; outside of any &#39;=over&#39;</p>
+
+</dd>
+<dt id="Around-line-2868">Around line 2868:</dt>
+<dd>
+
+<p>You forgot a &#39;=back&#39; before &#39;=head2&#39;</p>
+
+</dd>
+</dl>
+
 
 </body>
 
index d9fa075a0cb5ae584de2d18883c35e5d3ae0d40e..094002693096269b826cba9c6d084821c17fe30b 100644 (file)
@@ -965,7 +965,7 @@ sub prepare_for_new_input_lines {
 sub keyword_group_scan {
     my $self = shift;
 
-    # Handle blank lines around keyword groups (kgb* flags)
+    # Manipulate blank lines around keyword groups (kgb* flags)
     # Scan all lines looking for runs of consecutive lines beginning with
     # selected keywords.  Example keywords are 'my', 'our', 'local', ... but
     # they may be anything.  We will set flags requesting that blanks be
@@ -974,9 +974,9 @@ sub keyword_group_scan {
     # they are not necessarily well formatted.
 
     # The output of this sub is a return hash ref whose keys are the indexes of
-    # lines after which we desire a blank line.  For line index i,
-    #     $rhash_of_desires->{$i} = 1 means we want a blank line AFTER this line
-    #     $rhash_of_desires->{$i} = 2 means we want THIS blank line removed
+    # lines after which we desire a blank line.  For line index i:
+    #     $rhash_of_desires->{$i} = 1 means we want a blank line AFTER line $i
+    #     $rhash_of_desires->{$i} = 2 means we want blank line $i removed
     my $rhash_of_desires = {};
 
     my $Opt_blanks_before = $rOpts->{'keyword-group-blanks-before'};   # '-kgbb'
@@ -999,7 +999,10 @@ sub keyword_group_scan {
     if (   $Opt_size_min && $Opt_size_min !~ /^\d+$/
         || $Opt_size_max && $Opt_size_max !~ /^\d+$/ )
     {
-        print STDERR "unexpected value for -kgbs: '$Opt_size'; ignoring\n"; 
+       Warn(<<EOM);
+Unexpected value for -kgbs: '$Opt_size'; expecting 'min' or 'min.max'; 
+ignoring all -kgb flags
+EOM
         return $rhash_of_desires
     }
     $Opt_size_min = 1 unless ($Opt_size_min);
@@ -5947,7 +5950,7 @@ sub make_keyword_group_list_pattern {
         && $rOpts->{'keyword-group-blanks-list'} )
     {
         $keyword_group_list_pattern =
-          make_block_pattern( '-kgbl', $rOpts->{'keyword-group-list'} );
+          make_block_pattern( '-kgbl', $rOpts->{'keyword-group-blanks-list'} );
     }
     return;
 }