line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Git::Lint::Check::Message::BodyLineLength; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
744
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
26
|
|
4
|
1
|
|
|
1
|
|
4
|
use warnings; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
24
|
|
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
|
|
60
|
use constant BODY_LENGTH => 68; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
207
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
my $check_name = 'body line length'; |
13
|
|
|
|
|
|
|
my $check_description = BODY_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
|
|
|
|
|
|
|
|
23
|
0
|
|
|
|
|
|
foreach my $line ( @{$lines_arref} ) { |
|
0
|
|
|
|
|
|
|
24
|
0
|
0
|
|
|
|
|
return 1 if length $line > BODY_LENGTH; |
25
|
|
|
|
|
|
|
} |
26
|
|
|
|
|
|
|
|
27
|
0
|
|
|
|
|
|
return; |
28
|
0
|
|
|
|
|
|
}; |
29
|
|
|
|
|
|
|
|
30
|
0
|
|
|
|
|
|
return $self->parse( |
31
|
|
|
|
|
|
|
input => $input, |
32
|
|
|
|
|
|
|
match => $match, |
33
|
|
|
|
|
|
|
check => $check_name . ' (' . $check_description . ')', |
34
|
|
|
|
|
|
|
); |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
1; |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
__END__ |