File tree Expand file tree Collapse file tree 5 files changed +19
-6
lines changed Expand file tree Collapse file tree 5 files changed +19
-6
lines changed Original file line number Diff line number Diff line change 11{{$NEXT}}
22
3+ - Changed the shebang config item to actually accept multi items on different
4+ lines. The old method of specifying more than one item on a single line,
5+ separated by spaces, will continue to work, but is no longer documented.
6+
7+
380.43 2016-03-27
49
510- Use the same improved "git status" code for Code::TidyAll::Git::Precommit as
Original file line number Diff line number Diff line change @@ -425,15 +425,15 @@ C<select>. e.g.
425425
426426=item shebang
427427
428- One or more words, separated by whitespace or on multiple lines, indicating
429- which shebang lines to accept. This is optional and further filters C<select > .
430- e.g.
428+ One or more words on multiple lines, indicating which shebang lines to
429+ accept. This is optional and further filters C<select > . e.g.
431430
432431 ; All files with no extension anywhere under bin that include a "perl" or
433432 ; "perl5" shebang line.
434433 select = bin/**/*
435434 ignore = bin/**/*.*
436- shebang = perl perl5
435+ shebang = perl
436+ shebang = perl5
437437
438438=item only_modes
439439
Original file line number Diff line number Diff line change @@ -454,7 +454,7 @@ sub find_matched_files {
454454 @selected = grep { !$is_ignored {$_ } } @selected ;
455455 }
456456 if ( my $shebang = $plugin -> shebang ) {
457- my $re = join ' |' , map {quotemeta } split ' ' , $shebang ;
457+ my $re = join ' |' , map {quotemeta } @{ $shebang } ;
458458 $re = qr / ^#!.*\b (?:$re )\b / ;
459459 @selected = grep {
460460 my $fh ;
Original file line number Diff line number Diff line change @@ -6,10 +6,12 @@ use base qw(Config::INI::Reader);
66
77our $VERSION = ' 0.44' ;
88
9+ my %multi_value = map { $_ => 1 } qw( select ignore shebang ) ;
10+
911sub set_value {
1012 my ( $self , $name , $value ) = @_ ;
1113
12- if ( $name eq ' select ' || $name eq ' ignore ' ) {
14+ if ( $multi_value { $name } ) {
1315 push @{ $self -> {data }{ $self -> current_section }{$name } }, $value ;
1416 return ;
1517 }
Original file line number Diff line number Diff line change @@ -37,6 +37,12 @@ around BUILDARGS => sub {
3737
3838 my $args = $class -> $orig (@_ );
3939
40+ # When the feature was first released it was documented as accepting a
41+ # space separated list, and we want that to still work.
42+ if ( defined $args -> {shebang } && !ref $args -> {shebang } ) {
43+ $args -> {shebang } = [ split /\s +/, $args -> {shebang } ];
44+ }
45+
4046 for my $key (qw( select ignore ) ) {
4147 if ( defined $args -> {$key } && !ref $args -> {$key } ) {
4248 $args -> {$key } = [ $args -> {$key } ];
You can’t perform that action at this time.
0 commit comments