- Added parameters -bbhb=n (--break-before-hash-brace=n), -bbsb=n (--break-before-square-bracket=n),
and -bbp=n (--break-before-paren=n) suggested in git #38. These provide control over the
- opening container token of a multiple-line list. Related new parameters -ihb=n, -isb=n, -ip=n
+ opening container token of a multiple-line list. Related new parameters -bbhbi=n, -bbsbi=n, -bbpi=n
control indentation of these tokens.
- Numerous issues have been found during automated testing and fixed. Many involve references to
=item *
-This parameter only applies to opening hash braces which are preceded by an '='
-or '=>'.
+This parameter only applies if the opening brace is preceded by an '='
+or '=>' or ','.
=item *
The indentation of the braces will normally be one level of continuation
indentation by default. This can be changed with the parameter
-B<--indent-hash-brace=n> in the next section.
+B<-bbhbi=n> in the next section.
=item *
=back
-=item B<-ihb=n>, B<--indent-hash-brace=n>
+=item B<-bbhbi=n>, B<--break-before-hash-brace-and-indent=n>
This flag is a companion to B<-bbhb=n> for controlling the indentation of an opening hash brace
which is placed on a new line by that parameter. The indentation is as follows:
- -ihb=0 one continuation level [default]
- -ihb=1 outdent by one continuation level
- -ihb=2 indent one full indentation level
+ -bbhbi=0 one continuation level [default]
+ -bbhbi=1 outdent by one continuation level
+ -bbhbi=2 indent one full indentation level
For example:
- # perltidy -bbhb=3 -ihb=1
+ # perltidy -bbhb=3 -bbhbi=1
$romanNumerals =
{
one => 'I',
four => 'IV',
};
- # perltidy -bbhb=3 -ihb=2
+ # perltidy -bbhb=3 -bbhbi=2
$romanNumerals =
{
one => 'I',
four => 'IV',
};
+Note that this parameter has no effect unless B<-bbhb=n> is also set.
+
=item B<-bbsb=n>, B<--break-before-square-bracket=n>
-This flag is similar to the flag described above, except it applies to square brackets.
+This flag is similar to the flag described above, except it applies to lists contained within square brackets.
-bbsb=0 never break [default]
-bbsb=1 stable: break if the input script had a break
-bbsb=2 break if list is 'complex' (part of nested list structure)
-bbsb=3 always break
-=item B<-isb=n>, B<--indent-square-bracket=n>
+=item B<-bbsbi=n>, B<--break-before-square-bracket-and-indent=n>
This flag is a companion to B<-bbsb=n> for controlling the indentation of an opening square bracket
which is placed on a new line by that parameter. The indentation is as follows:
- -isb=0 one continuation level [default]
- -isb=1 outdent by one continuation level
- -isb=2 indent one full indentation level
+ -bbsbi=0 one continuation level [default]
+ -bbsbi=1 outdent by one continuation level
+ -bbsbi=2 indent one full indentation level
=item B<-bbp=n>, B<--break-before-paren=n>
-This flag is similar to B<-bbhb=n>, described above, except it applies to parens.
+This flag is similar to B<-bbhb=n>, described above, except it applies to lists contained within parens.
-bbp=0 never break [default]
-bbp=1 stable: break if the input script had a break
-bpb=2 break if list is 'complex' (part of nested list structure)
-bbp=3 always break
-=item B<-ip=n>, B<--indent-paren=n>
+=item B<-bbpi=n>, B<--break-before-paren-and-indent=n>
This flag is a companion to B<-bbp=n> for controlling the indentation of an opening paren
which is placed on a new line by that parameter. The indentation is as follows:
- -ip=0 one continuation level [default]
- -ip=1 outdent by one continuation level
- -ip=2 indent one full indentation level
-
+ -bbpi=0 one continuation level [default]
+ -bbpi=1 outdent by one continuation level
+ -bbpi=2 indent one full indentation level
=item B<-wn>, B<--weld-nested-containers>
- Added parameters -bbhb=n (--break-before-hash-brace=n), -bbsb=n (--break-before-square-bracket=n),
and -bbp=n (--break-before-paren=n) suggested in git #38. These provide control over the
- opening container token of a multiple-line list. Related new parameters -ihb=n, -isb=n, -ip=n
+ opening container token of a multiple-line list. Related new parameters -bbhbi=n, -bbsbi=n, -bbpi=n
control indentation of these tokens.
- Numerous issues have been found during automated testing and fixed. Many involve references to
<ul>
-<li><p>This parameter only applies to opening hash braces which are preceded by an '=' or '=>'.</p>
+<li><p>This parameter only applies if the opening brace is preceded by an '=' or '=>' or ','.</p>
</li>
<li><p>This parameter only applies if the contents of the container looks like a list. The contents need to contain some commas or '=>'s at the next interior level to be considered a list.</p>
<li><p>If multiple opening tokens have been 'welded' together with the <b>-wn</b> parameter, then this parameter has no effect.</p>
</li>
-<li><p>The indentation of the braces will normally be one level of continuation indentation by default. This can be changed with the parameter <b>--indent-hash-brace=n</b> in the next section.</p>
+<li><p>The indentation of the braces will normally be one level of continuation indentation by default. This can be changed with the parameter <b>-bbhbi=n</b> in the next section.</p>
</li>
<li><p>Similar flags for controlling parens and square brackets are given in the subsequent section.</p>
</ul>
</dd>
-<dt id="ihb-n---indent-hash-brace-n"><b>-ihb=n</b>, <b>--indent-hash-brace=n</b></dt>
+<dt id="bbhbi-n---break-before-hash-brace-and-indent-n"><b>-bbhbi=n</b>, <b>--break-before-hash-brace-and-indent=n</b></dt>
<dd>
<p>This flag is a companion to <b>-bbhb=n</b> for controlling the indentation of an opening hash brace which is placed on a new line by that parameter. The indentation is as follows:</p>
-<pre><code> -ihb=0 one continuation level [default]
- -ihb=1 outdent by one continuation level
- -ihb=2 indent one full indentation level</code></pre>
+<pre><code> -bbhbi=0 one continuation level [default]
+ -bbhbi=1 outdent by one continuation level
+ -bbhbi=2 indent one full indentation level</code></pre>
<p>For example:</p>
-<pre><code> # perltidy -bbhb=3 -ihb=1
+<pre><code> # perltidy -bbhb=3 -bbhbi=1
$romanNumerals =
{
one => 'I',
four => 'IV',
};
- # perltidy -bbhb=3 -ihb=2
+ # perltidy -bbhb=3 -bbhbi=2
$romanNumerals =
{
one => 'I',
four => 'IV',
};</code></pre>
+<p>Note that this parameter has no effect unless <b>-bbhb=n</b> is also set.</p>
+
</dd>
<dt id="bbsb-n---break-before-square-bracket-n"><b>-bbsb=n</b>, <b>--break-before-square-bracket=n</b></dt>
<dd>
-<p>This flag is similar to the flag described above, except it applies to square brackets.</p>
+<p>This flag is similar to the flag described above, except it applies to lists contained within square brackets.</p>
<pre><code> -bbsb=0 never break [default]
-bbsb=1 stable: break if the input script had a break
-bbsb=3 always break</code></pre>
</dd>
-<dt id="isb-n---indent-square-bracket-n"><b>-isb=n</b>, <b>--indent-square-bracket=n</b></dt>
+<dt id="bbsbi-n---break-before-square-bracket-and-indent-n"><b>-bbsbi=n</b>, <b>--break-before-square-bracket-and-indent=n</b></dt>
<dd>
<p>This flag is a companion to <b>-bbsb=n</b> for controlling the indentation of an opening square bracket which is placed on a new line by that parameter. The indentation is as follows:</p>
-<pre><code> -isb=0 one continuation level [default]
- -isb=1 outdent by one continuation level
- -isb=2 indent one full indentation level</code></pre>
+<pre><code> -bbsbi=0 one continuation level [default]
+ -bbsbi=1 outdent by one continuation level
+ -bbsbi=2 indent one full indentation level</code></pre>
</dd>
<dt id="bbp-n---break-before-paren-n"><b>-bbp=n</b>, <b>--break-before-paren=n</b></dt>
<dd>
-<p>This flag is similar to <b>-bbhb=n</b>, described above, except it applies to parens.</p>
+<p>This flag is similar to <b>-bbhb=n</b>, described above, except it applies to lists contained within parens.</p>
<pre><code> -bbp=0 never break [default]
-bbp=1 stable: break if the input script had a break
-bbp=3 always break</code></pre>
</dd>
-<dt id="ip-n---indent-paren-n"><b>-ip=n</b>, <b>--indent-paren=n</b></dt>
+<dt id="bbpi-n---break-before-paren-and-indent-n"><b>-bbpi=n</b>, <b>--break-before-paren-and-indent=n</b></dt>
<dd>
<p>This flag is a companion to <b>-bbp=n</b> for controlling the indentation of an opening paren which is placed on a new line by that parameter. The indentation is as follows:</p>
-<pre><code> -ip=0 one continuation level [default]
- -ip=1 outdent by one continuation level
- -ip=2 indent one full indentation level</code></pre>
+<pre><code> -bbpi=0 one continuation level [default]
+ -bbpi=1 outdent by one continuation level
+ -bbpi=2 indent one full indentation level</code></pre>
</dd>
<dt id="wn---weld-nested-containers"><b>-wn</b>, <b>--weld-nested-containers</b></dt>
$add_option->( 'one-line-block-semicolons', 'olbs', '=i' );
$add_option->( 'one-line-block-nesting', 'olbn', '=i' );
$add_option->( 'break-before-hash-brace', 'bbhb', '=i' );
+ $add_option->( 'break-before-hash-brace-and-indent', 'bbhbi', '=i' );
$add_option->( 'break-before-square-bracket', 'bbsb', '=i' );
+ $add_option->( 'break-before-square-bracket-and-indent', 'bbsbi', '=i' );
$add_option->( 'break-before-paren', 'bbp', '=i' );
- $add_option->( 'indent-hash-brace', 'ihb', '=i' );
- $add_option->( 'indent-square-bracket', 'isb', '=i' );
- $add_option->( 'indent-paren', 'ip', '=i' );
+ $add_option->( 'break-before-paren-and-indent', 'bbpi', '=i' );
########################################
$category = 6; # Controlling list formatting
break-at-old-attribute-breakpoints
break-at-old-keyword-breakpoints
break-before-hash-brace=0
+ break-before-hash-brace-and-indent=0
break-before-square-bracket=0
+ break-before-square-bracket-and-indent=0
break-before-paren=0
- indent-hash-brace=0
- indent-square-bracket=0
- indent-paren=0
+ break-before-paren-and-indent=0
comma-arrow-breakpoints=5
nocheck-syntax
character-encoding=guess
@is_closing_token{@q} = (1) x scalar(@q);
@q = qw( = => );
+ push @q, ','; # include ordinary comma too
@is_equal_or_fat_comma{@q} = (1) x scalar(@q);
}
sub adjust_container_indentation {
# adjust continuation indentation for certain tokens if requested
+ # by these flags:
- # -ihb=n , --indent-for-hash-brace=n
- # -isb=n , --indent-for-square-bracket=n
- # -ip=n , --indent-for-paren=n
+ # -bbhbi=n
+ # -bbsbi=n
+ # -bbpi=n
# n=0 default indentation (usually one ci)
# n=1 outdent one ci
}
%container_indentation_options = ();
- for ( $rOpts->{'indent-hash-brace'} ) {
+ for ( $rOpts->{'break-before-hash-brace-and-indent'} ) {
my $tok = '{';
if ( defined($_) && $_ > 0 && $break_before_container_types{$tok} ) {
$container_indentation_options{$tok} = $_;
}
}
- for ( $rOpts->{'indent-square-bracket'} ) {
+ for ( $rOpts->{'break-before-square-bracket-and-indent'} ) {
my $tok = '[';
if ( defined($_) && $_ > 0 && $break_before_container_types{$tok} ) {
$container_indentation_options{$tok} = $_;
}
}
- for ( $rOpts->{'indent-paren'} ) {
+ for ( $rOpts->{'break-before-paren-and-indent'} ) {
my $tok = '(';
if ( defined($_) && $_ > 0 && $break_before_container_types{$tok} ) {
$container_indentation_options{$tok} = $_;
my $seqno = $rLL->[$Kend]->[_TYPE_SEQUENCE_];
next unless ( defined($seqno) );
- # Only for types of container tokens with a non-default break option
+ # Only for types of container tokens with a non-default break option
my $token_end = $rLL->[$Kend]->[_TOKEN_];
my $break_option = $break_before_container_types{$token_end};
next unless ($break_option);
--bbhb=3 -bbp=3 -ihb=2 -ip=2
+-bbhb=3 -bbp=3 -bbhbi=2 -bbpi=2
--bbhb=3 -bbp=3 -ihb=1 -ip=1
+-bbhb=3 -bbp=3 -bbhbi=1 -bbpi=1
$rparams = {
'bbhb2' => "-bbhb=2 -bbp=2",
'bbhb3' => "-bbhb=3 -bbp=3",
- 'bbhb4' => "-bbhb=3 -bbp=3 -ihb=2 -ip=2",
- 'bbhb5' => "-bbhb=3 -bbp=3 -ihb=1 -ip=1",
+ 'bbhb4' => "-bbhb=3 -bbp=3 -bbhbi=2 -bbpi=2",
+ 'bbhb5' => "-bbhb=3 -bbp=3 -bbhbi=1 -bbpi=1",
'def' => "",
'here_long' => "-l=33",
};