File: 01-critic.t

package info (click to toggle)
libweasel-widgets-dojo-perl 0.07-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, forky, sid, trixie
  • size: 120 kB
  • sloc: perl: 181; makefile: 2
file content (49 lines) | stat: -rw-r--r-- 927 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#!perl

use strict;
use warnings;

use File::Find;
use Perl::Critic;
use Test::More;

sub test_files {
    my ($critic, $files) = @_;

    for my $file (@$files) {
        my @findings = $critic->critique($file);

        ok(scalar(@findings) == 0, "Critique for $file");
        for my $finding (@findings) {
            diag($finding->description);
        }
    }

    return;
}


my @on_disk;
sub collect {
    return if $File::Find::name !~ m/\.pm$/;

    my $module = $File::Find::name;
    push @on_disk, $module
}
find(\&collect, 'lib/');

test_files(Perl::Critic->new(
               -profile => 't/perlcriticrc',
               -severity => 5,
               -theme => '',
               -exclude => [
                    'OTRS::',  # some CPANtesters use this by default
               ],
               -include => [
#                    'Documentation::'
               ]),
           \@on_disk);


done_testing;