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 1
1
{{$NEXT}}
2
2
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
+
3
8
0.43 2016-03-27
4
9
5
10
- 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.
425
425
426
426
=item shebang
427
427
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.
431
430
432
431
; All files with no extension anywhere under bin that include a "perl" or
433
432
; "perl5" shebang line.
434
433
select = bin/**/*
435
434
ignore = bin/**/*.*
436
- shebang = perl perl5
435
+ shebang = perl
436
+ shebang = perl5
437
437
438
438
=item only_modes
439
439
Original file line number Diff line number Diff line change @@ -454,7 +454,7 @@ sub find_matched_files {
454
454
@selected = grep { !$is_ignored {$_ } } @selected ;
455
455
}
456
456
if ( my $shebang = $plugin -> shebang ) {
457
- my $re = join ' |' , map {quotemeta } split ' ' , $shebang ;
457
+ my $re = join ' |' , map {quotemeta } @{ $shebang } ;
458
458
$re = qr / ^#!.*\b (?:$re )\b / ;
459
459
@selected = grep {
460
460
my $fh ;
Original file line number Diff line number Diff line change @@ -6,10 +6,12 @@ use base qw(Config::INI::Reader);
6
6
7
7
our $VERSION = ' 0.44' ;
8
8
9
+ my %multi_value = map { $_ => 1 } qw( select ignore shebang ) ;
10
+
9
11
sub set_value {
10
12
my ( $self , $name , $value ) = @_ ;
11
13
12
- if ( $name eq ' select ' || $name eq ' ignore ' ) {
14
+ if ( $multi_value { $name } ) {
13
15
push @{ $self -> {data }{ $self -> current_section }{$name } }, $value ;
14
16
return ;
15
17
}
Original file line number Diff line number Diff line change @@ -37,6 +37,12 @@ around BUILDARGS => sub {
37
37
38
38
my $args = $class -> $orig (@_ );
39
39
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
+
40
46
for my $key (qw( select ignore ) ) {
41
47
if ( defined $args -> {$key } && !ref $args -> {$key } ) {
42
48
$args -> {$key } = [ $args -> {$key } ];
You can’t perform that action at this time.
0 commit comments