mean all blocks except B<sort map grep eval> and anonymous sub blocks.
Note that the lists B<-bll=s> and B<-blxl=s> control the behavior of the
-B<-bl> flag but have no effect unless the B<-bl> flag is set.
+B<-bl> flag but have no effect unless the B<-bl> flag is set. These
+two lists provide complete control for this flag, but two shortcut
+flags are available and described in the next sections.
=item B<-sbl>, B<--opening-sub-brace-on-new-line>
-The flag B<-sbl> provides a shortcut way to turn on B<-bl> just for named
-subs. The same effect can be achieved by turning on B<-bl>
-with the block list set as B<-bll='sub'>.
+The flag B<-sbl> provides a shortcut way to turn on B<-bl> just for named subs.
+The same effect can be achieved by turning on B<-bl> with the block list set as
+B<-bll='sub'>. To avoid conflicts, it is recommended to either use the more
+general list method described above to control B<-bl>, or this shortcut method,
+but not both.
For example,
}
}
-This flag is negated with B<-nsbl>, which is the default.
+This negative version of this flag, B<-nsbl>, turns off B<-bl> for
+named subs. The same effect can be achieved with the exclusion
+list method, B<-blxl=sub>.
=item B<-asbl>, B<--opening-anonymous-sub-brace-on-new-line>
-The flag B<-asbl> is like the B<-sbl> flag except that it applies
-to anonymous sub's instead of named subs. For example
+The flag B<-asbl> is like the B<-sbl> flag except that it applies to anonymous
+sub's instead of named subs. The same effect can be achieved by turning on
+B<-bl> with the block list set to include B<-bll='asub'>.
+
+For example
perltidy -asbl
}
};
-This flag is negated with B<-nasbl>, and the default is B<-nasbl>.
+This negative version of this flag, B<-nasbl>, turns off B<-bl> for
+anonymous subs.
=item B<-bli>, B<--brace-left-and-indent>
# for -bl, a list with '*' turns on -sbl and -asbl
if ( $bl_pattern =~ /\.\*/ ) {
- $rOpts->{'opening-sub-brace-on-new-line'} ||=
- $rOpts->{'opening-brace-on-new-line'};
- $rOpts->{'opening-anonymous-sub-brace-on-new-line'} ||=
- $rOpts->{'opening-anonymous-brace-on-new-line'};
+ if ( !defined( $rOpts->{'opening-sub-brace-on-new-line'} ) ) {
+ $rOpts->{'opening-sub-brace-on-new-line'} =
+ $rOpts->{'opening-brace-on-new-line'};
+ }
+ if ( !defined( $rOpts->{'opening-anonymous-sub-brace-on-new-line'} ) ) {
+ $rOpts->{'opening-anonymous-sub-brace-on-new-line'} =
+ $rOpts->{'opening-anonymous-brace-on-new-line'};
+ }
}
if ( defined( $rOpts->{'brace-left-exclusion-list'} )
../snippets30.t dltc.dltc1
../snippets30.t dltc.dltc2
../snippets30.t logical_xor.def
+../snippets30.t csc.csc3
../snippets4.t gnu1.gnu
../snippets4.t gnu2.def
../snippets4.t gnu2.gnu
../snippets9.t rt98902.def
../snippets9.t rt98902.rt98902
../snippets9.t rt99961.def
-../snippets30.t csc.csc3
+../snippets30.t git159.def
+../snippets30.t git159.git159
#10 dltc.dltc2
#11 logical_xor.def
#12 csc.csc3
+#13 git159.def
+#14 git159.git159
# To locate test #13 you can search for its name or the string '#13'
---unknown-future-option
---wtc=h
----------
+ 'git159' => "-bl -nsbl",
};
############################
);
----------
+ 'git159' => <<'----------',
+sub example {
+ my $ex = 0;
+ if ($ex)
+ {
+ print "yay\n";
+ }
+}
+----------
+
'logical_xor' => <<'----------',
$x^^$y and say "One of x or y is true, but not both";
----------
}; ## end $message = sub
#12...........
},
+
+ 'git159.def' => {
+ source => "git159",
+ params => "def",
+ expect => <<'#13...........',
+sub example {
+ my $ex = 0;
+ if ($ex) {
+ print "yay\n";
+ }
+}
+#13...........
+ },
+
+ 'git159.git159' => {
+ source => "git159",
+ params => "git159",
+ expect => <<'#14...........',
+sub example {
+ my $ex = 0;
+ if ($ex)
+ {
+ print "yay\n";
+ }
+}
+#14...........
+ },
};
my $ntests = 0 + keys %{$rtests};