File: perlcritic.t

package info (click to toggle)
libpostscript-file-perl 2.23%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster
  • size: 828 kB
  • sloc: perl: 7,056; makefile: 2
file content (31 lines) | stat: -rw-r--r-- 1,005 bytes parent folder | download | duplicates (3)
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
#! /usr/bin/perl
#---------------------------------------------------------------------
# $Id: perlcritic.t 2035 2008-06-25 23:41:21Z cjm $
#---------------------------------------------------------------------

use Test::More;

plan skip_all => "Don't want automated Perl::Critic reports"
    if $ENV{AUTOMATED_TESTING};

# ProhibitAccessOfPrivateData is a badly implemented policy that bans
# all use of hashrefs
eval <<'';
use Test::Perl::Critic (qw(-verbose 10
                           -exclude) => ['ProhibitAccessOfPrivateData']);
use Perl::Critic::Utils 'all_perl_files';
use File::Spec ();

plan skip_all => "Test::Perl::Critic required for testing PBP compliance" if $@;

# I don't want to check the Metrics data files:

my $skipRE = File::Spec->catfile(qw(lib PostScript File Metrics x));
chop $skipRE;                   # Remove the x
$skipRE = qr/\Q$skipRE\E(?!Loader)/;

my @files = grep { not $_ =~ $skipRE } all_perl_files('lib');

plan tests => scalar @files;

critic_ok($_) for @files;