line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Git::Lint::Check::Message::SummaryLength; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
722
|
use strict; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
24
|
|
4
|
1
|
|
|
1
|
|
4
|
use warnings; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
23
|
|
5
|
|
|
|
|
|
|
|
6
|
1
|
|
|
1
|
|
4
|
use parent 'Git::Lint::Check::Message'; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
5
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
our $VERSION = '0.015'; |
9
|
|
|
|
|
|
|
|
10
|
1
|
|
|
1
|
|
71
|
use constant SUMMARY_LENGTH => 50; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
195
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
my $check_name = 'summary length'; |
13
|
|
|
|
|
|
|
my $check_description = SUMMARY_LENGTH . ' characters or less'; |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
sub check { |
16
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
17
|
0
|
|
|
|
|
|
my $input = shift; |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
my $match = sub { |
20
|
0
|
|
|
0
|
|
|
my $lines_arref = shift; |
21
|
0
|
|
|
|
|
|
my $summary = shift @{$lines_arref}; |
|
0
|
|
|
|
|
|
|
22
|
0
|
0
|
|
|
|
|
return 1 if length $summary > SUMMARY_LENGTH; |
23
|
0
|
|
|
|
|
|
return; |
24
|
0
|
|
|
|
|
|
}; |
25
|
|
|
|
|
|
|
|
26
|
0
|
|
|
|
|
|
return $self->parse( |
27
|
|
|
|
|
|
|
input => $input, |
28
|
|
|
|
|
|
|
match => $match, |
29
|
|
|
|
|
|
|
check => $check_name . ' (' . $check_description . ')', |
30
|
|
|
|
|
|
|
); |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
1; |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
__END__ |