summaryrefslogtreecommitdiff
blob: 902881152fdb501983dee9ce9d4a608f73ad5fde (plain)
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
use 5.10.1;
use strict;
use warnings;
use lib qw(. lib t);

=pod

This file tests for the settings recommended by CERT[1] as it's
security related we run it all the time

1: https://gist.github.com/briandfoy/4525877

=cut

use Test::More;

# these tests are not optional
use Test::Perl::Critic;

Test::Perl::Critic->import(
  -verbose  => 8,
  -severity => 3,
  -theme    => 'certrec || certrule || security',
  -exclude  => [
    'ProhibitAccessOfPrivateData',      # false positives
    'ProhibitLeadingZeros',             # needed for file permisions
    'RequireFilenameMatchesPackage',    # Extensions fail this
    'ProhibitMagicNumbers',             # Bollocks
    'ProhibitUnusedPrivateSubroutines', 'RequireEndWithOne', # extensions end with their name for some reason ....
    'ProhibitHashBarewords',         # bollocks
    'ProhibitIndirectSyntax',        # later
    'RequireCarping',                # later
    'RequireUseWarnings',            # later
    'ProhibitBuiltinHomonyms',       # later
    'ProtectPrivateSubs',            # later
    'ProtectPrivateVars',            # later as search uses this deliberately ...
    'ProhibitCaptureWithoutTest',    # later, doesn't recognise ThrowError
    'TestingAndDebugging::ProhibitNoWarnings', # tactically using no warning is the right way to do things
  ]
);

Test::Perl::Critic::all_critic_ok(qw {
    Bugzilla/BugMail.pm
    extensions/ActivityReport
    extensions/AgileTools
    extensions/AntiSpam
    extensions/AuthJWT
    extensions/BayotBase
    extensions/BugViewPlus
    extensions/ComponentWatching
    extensions/DependentProducts
    extensions/EditTable
    extensions/ExternalBugs
    extensions/FontAwesome
    extensions/InlineHistory
    extensions/ListOfBugs
    extensions/MultipleValues
    extensions/ProductDashboard
    extensions/Push
    extensions/RedHat
    extensions/Releases
    extensions/RuleEngine
    extensions/SAML2Auth
    extensions/SecureMail
    extensions/SelectizeJS
    extensions/SubComponents
    extensions/TreeViewPlus
    extensions/Voting
    extensions/Workflows
    redhat
    });