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
=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
<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<-mbl=n> flag
+ n=2 keep all old blank lines, regardless of the value of the B<-mbl=n> 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<-mbl=n> flag
- n=2 keep all old blank lines, regardless of the value of the B<-mbl=n> 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 "GNU General Public License" 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>'=item' outside of any '=over'</p>
+
+</dd>
+<dt id="Around-line-2868">Around line 2868:</dt>
+<dd>
+
+<p>You forgot a '=back' before '=head2'</p>
+
+</dd>
+</dl>
+
</body>
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
# 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'
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);
&& $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;
}