From: Peter Rabbitson Date: Tue, 24 May 2016 11:55:31 +0000 (+0200) Subject: Fix incorrect whitespace test outside of checkouts X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=fecbfe179d254bbcc8b2df8382a91dcd598dd022;p=dbsrgits%2FDBIx-Class-Historic.git Fix incorrect whitespace test outside of checkouts I stupidly broke it in 1fb834df --- diff --git a/xt/dist/postdistdir/whitespace.t b/xt/dist/postdistdir/whitespace.t index 17b2060..a825c1e 100644 --- a/xt/dist/postdistdir/whitespace.t +++ b/xt/dist/postdistdir/whitespace.t @@ -27,9 +27,19 @@ Test::EOL::all_perl_files_ok({ trailing_whitespace => 1 }, @pl_targets); Test::NoTabs::all_perl_files_ok(@pl_targets); # check some non-"perl files" in the root separately -my @root_files = grep { -f $_ } bsd_glob('*'); +# start with what we want to check no matter what .gitignore says +my @root_files = grep { -f $_ } qw( + Changes + LICENSE + AUTHORS + README + MANIFEST + META.yml + META.json +); -# use .gitignore as a partial guide of what to skip +# if .gitignore is available - go for * and use .gitignore as a guide +# of what to skip if (open(my $gi, '<', '.gitignore')) { my $skipnames; while (my $ln = <$gi>) { @@ -38,18 +48,13 @@ if (open(my $gi, '<', '.gitignore')) { $skipnames->{$_}++ for bsd_glob($ln); } - # these we want to check no matter what the above says - delete @{$skipnames}{qw( - Changes - LICENSE - AUTHORS - README - MANIFEST - META.yml - META.json - )}; - - @root_files = grep { ! $skipnames->{$_} } @root_files; + delete @{$skipnames}{@root_files}; + + @root_files = grep { + ! $skipnames->{$_} + and + -f $_ + } bsd_glob('*'); } for my $fn (@root_files) {