Add modules used in author tests to develop-requires
[dbsrgits/SQL-Abstract.git] / xt / 92whitespace.t
1 use warnings;
2 use strict;
3
4 use Test::More;
5 use File::Glob 'bsd_glob';
6
7 use Test::EOL 1.0 ();
8 use Test::NoTabs 0.9 ();
9
10 # FIXME - temporary workaround for RT#82032, RT#82033
11 # also add all scripts (no extension) and some extra extensions
12 # we want to check
13 {
14   no warnings 'redefine';
15   my $is_pm = sub {
16     $_[0] !~ /\./ || $_[0] =~ /\.(?:pm|pod|skip|bash|sql|json|proto)$/i || $_[0] =~ /::/;
17   };
18
19   *Test::EOL::_is_perl_module = $is_pm;
20   *Test::NoTabs::_is_perl_module = $is_pm;
21 }
22
23 my @pl_targets = qw/t lib examples/;
24 Test::EOL::all_perl_files_ok({ trailing_whitespace => 1 }, @pl_targets);
25 Test::NoTabs::all_perl_files_ok(@pl_targets);
26
27 # check some non-"perl files" in the root separately
28 # use .gitignore as a guide of what to skip
29 # (or do not test at all if no .gitignore is found)
30 if (open(my $gi, '<', '.gitignore')) {
31   my $skipnames;
32   while (my $ln = <$gi>) {
33     next if $ln =~ /^\s*$/;
34     chomp $ln;
35     $skipnames->{$_}++ for bsd_glob($ln);
36   }
37
38   # that we want to check anyway
39   delete $skipnames->{'META.yml'};
40
41   for my $fn (bsd_glob('*')) {
42     next if $skipnames->{$fn};
43     next unless -f $fn;
44     Test::EOL::eol_unix_ok($fn, { trailing_whitespace => 1 });
45     Test::NoTabs::notabs_ok($fn);
46   }
47 }
48
49 # FIXME - Test::NoTabs and Test::EOL declare 'no_plan' which conflicts with done_testing
50 # https://github.com/schwern/test-more/issues/14
51 #done_testing;