line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
2
|
|
|
2
|
|
2685
|
use v5.16; |
|
2
|
|
|
|
|
7
|
|
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
package Module::Release::Kwalitee; |
4
|
|
|
|
|
|
|
|
5
|
2
|
|
|
2
|
|
11
|
use strict; |
|
2
|
|
|
|
|
12
|
|
|
2
|
|
|
|
|
67
|
|
6
|
2
|
|
|
2
|
|
11
|
use warnings; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
80
|
|
7
|
2
|
|
|
2
|
|
11
|
use Exporter qw(import); |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
418
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
our @EXPORT = qw(check_kwalitee cpants_lint cpants_pass_regex ); |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
our $VERSION = '2.131'; |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
=encoding utf8 |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
=head1 NAME |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
Module::Release::Kwalitee - Play the CPANTS game |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
=head1 SYNOPSIS |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
The release script automatically loads this module if it thinks that you |
22
|
|
|
|
|
|
|
want to check the kwalitee of your module. |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
=head1 DESCRIPTION |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
=over 4 |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
=item check_kwalitee |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
Run `cpants_lints.pl distname.tgz`. If it doesn't see "a 'perfect' distribution" |
31
|
|
|
|
|
|
|
it dies. |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
It looks in local_name to get the name of the distribution file. |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
=cut |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
sub check_kwalitee |
38
|
|
|
|
|
|
|
{ |
39
|
1
|
|
|
1
|
1
|
897
|
my $cpants_analyse = "Module::CPANTS::Analyse"; |
40
|
1
|
|
|
|
|
9
|
my $cpants_lint = "App::CPANTS::Lint"; |
41
|
1
|
50
|
|
|
|
187
|
eval "require $cpants_analyse; require $cpants_lint; 1" or |
42
|
|
|
|
|
|
|
$_[0]->_die( "You need $cpants_analyse and $cpants_lint to check kwalitee" ); |
43
|
|
|
|
|
|
|
|
44
|
0
|
|
|
|
|
|
$_[0]->_print( "Checking kwalitee... " ); |
45
|
|
|
|
|
|
|
|
46
|
0
|
|
|
|
|
|
my $name = $_[0]->local_file; |
47
|
0
|
|
|
|
|
|
my $program = $_[0]->cpants_lint; |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
{ |
50
|
2
|
|
|
2
|
|
15
|
no warnings 'uninitialized'; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
503
|
|
|
0
|
|
|
|
|
|
|
51
|
0
|
0
|
|
|
|
|
$_[0]->_die( " no $name---aborting release\n" ) unless -e $name; |
52
|
|
|
|
|
|
|
} |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
# XXX: what if it's not .tar.gz? |
55
|
0
|
|
|
|
|
|
my $messages = $_[0]->run( "$program $name" ); |
56
|
|
|
|
|
|
|
|
57
|
0
|
|
|
|
|
|
my $regex = $_[0]->cpants_pass_regex; |
58
|
|
|
|
|
|
|
|
59
|
0
|
0
|
|
|
|
|
$_[0]->_die( "Kwalitee is less than perfect:\n$messages\n" ) |
60
|
|
|
|
|
|
|
unless $messages =~ m/$regex/; |
61
|
|
|
|
|
|
|
|
62
|
0
|
|
|
|
|
|
$_[0]->_print( "done\n" ); |
63
|
|
|
|
|
|
|
} |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
=item cpants_lint |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
=cut |
68
|
|
|
|
|
|
|
|
69
|
0
|
|
|
0
|
1
|
|
sub cpants_lint { "cpants_lint.pl" } |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
=item cpants_pass_regex |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
The regex to use to evaluate the output of cpants_lint.pl to see |
74
|
|
|
|
|
|
|
if everything was okay. |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
=cut |
77
|
|
|
|
|
|
|
|
78
|
0
|
|
|
0
|
1
|
|
sub cpants_pass_regex { qr/a 'perfect' distribution!/ } |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
=back |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
=head1 SEE ALSO |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
L |
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
=head1 SOURCE AVAILABILITY |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
This source is in GitHub |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
https://github.com/briandfoy/module-release |
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
=head1 AUTHOR |
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
brian d foy, C<< >> |
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
97
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
Copyright © 2007-2023, brian d foy C<< >>. All rights reserved. |
99
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify |
101
|
|
|
|
|
|
|
it under the Artistic License 2.0. |
102
|
|
|
|
|
|
|
|
103
|
|
|
|
|
|
|
=cut |
104
|
|
|
|
|
|
|
|
105
|
|
|
|
|
|
|
1; |