5 use File::Glob 'bsd_glob';
7 use DBICTest ':GlobalLock';
10 unless ( DBIx::Class::Optional::Dependencies->req_ok_for ('test_whitespace') ) {
11 my $missing = DBIx::Class::Optional::Dependencies->req_missing_for ('test_whitespace');
13 ? die ("Failed to load release-testing module requirements: $missing")
14 : plan skip_all => "Test needs: $missing"
17 # FIXME - temporary workaround for RT#82032, RT#82033
18 # also add all scripts (no extension) and some extra extensions
21 no warnings 'redefine';
23 $_[0] !~ /\./ || $_[0] =~ /\.(?:pm|pod|skip|bash|sql|json|proto)$/i || $_[0] =~ /::/;
26 *Test::EOL::_is_perl_module = $is_pm;
27 *Test::NoTabs::_is_perl_module = $is_pm;
30 my @pl_targets = qw/t xt lib script examples maint/;
31 Test::EOL::all_perl_files_ok({ trailing_whitespace => 1 }, @pl_targets);
32 Test::NoTabs::all_perl_files_ok(@pl_targets);
34 # check some non-"perl files" in the root separately
35 # use .gitignore as a guide of what to skip
36 # (or do not test at all if no .gitignore is found)
37 if (open(my $gi, '<', '.gitignore')) {
39 while (my $ln = <$gi>) {
40 next if $ln =~ /^\s*$/;
42 $skipnames->{$_}++ for bsd_glob($ln);
45 # that we want to check anyway
46 delete $skipnames->{'META.yml'};
48 for my $fn (bsd_glob('*')) {
49 next if $skipnames->{$fn};
51 Test::EOL::eol_unix_ok($fn, { trailing_whitespace => 1 });
52 Test::NoTabs::notabs_ok($fn);
56 # FIXME - Test::NoTabs and Test::EOL declare 'no_plan' which conflicts with done_testing
57 # https://github.com/schwern/test-more/issues/14