line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Code::TidyAll::Plugin::PodChecker; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
523
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
30
|
|
4
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
25
|
|
5
|
|
|
|
|
|
|
|
6
|
1
|
|
|
1
|
|
4
|
use Pod::Checker; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
117
|
|
7
|
1
|
|
|
1
|
|
7
|
use Specio::Library::Numeric; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
14
|
|
8
|
|
|
|
|
|
|
|
9
|
1
|
|
|
1
|
|
8607
|
use Moo; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
17
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
extends 'Code::TidyAll::Plugin'; |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
our $VERSION = '0.83'; |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
has warnings => ( |
16
|
|
|
|
|
|
|
is => 'ro', |
17
|
|
|
|
|
|
|
isa => t('PositiveInt'), |
18
|
|
|
|
|
|
|
); |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
sub validate_file { |
21
|
6
|
|
|
6
|
1
|
15
|
my ( $self, $file ) = @_; |
22
|
|
|
|
|
|
|
|
23
|
6
|
|
|
|
|
8
|
my $result; |
24
|
6
|
100
|
|
|
|
30
|
my %options = ( $self->warnings ? ( '-warnings' => $self->warnings ) : () ); |
25
|
6
|
|
|
|
|
49
|
my $checker = Pod::Checker->new(%options); |
26
|
6
|
|
|
|
|
625
|
my $output; |
27
|
1
|
|
|
1
|
|
7
|
open my $fh, '>', \$output; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
7
|
|
|
6
|
|
|
|
|
83
|
|
28
|
6
|
|
|
|
|
853
|
$checker->parse_from_file( $file->stringify, $fh ); |
29
|
6
|
100
|
100
|
|
|
6996
|
die $output |
|
|
|
100
|
|
|
|
|
30
|
|
|
|
|
|
|
if $checker->num_errors > 0 |
31
|
|
|
|
|
|
|
|| ( $self->warnings && $checker->num_warnings > 0 ); |
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
1; |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
# ABSTRACT: Use podchecker with tidyall |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
__END__ |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
=pod |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
=encoding UTF-8 |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
=head1 NAME |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
Code::TidyAll::Plugin::PodChecker - Use podchecker with tidyall |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
=head1 VERSION |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
version 0.83 |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
=head1 SYNOPSIS |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
In configuration: |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
; Check for errors, but ignore warnings |
57
|
|
|
|
|
|
|
; |
58
|
|
|
|
|
|
|
[PodChecker] |
59
|
|
|
|
|
|
|
select = lib/**/*.{pm,pod} |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
; Die on level 1 warnings (can also be set to 2) |
62
|
|
|
|
|
|
|
; |
63
|
|
|
|
|
|
|
[PodChecker] |
64
|
|
|
|
|
|
|
select = lib/**/*.{pm,pod} |
65
|
|
|
|
|
|
|
warnings = 1 |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
=head1 DESCRIPTION |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
Runs L<podchecker>, a POD validator, and dies if any problems were found. |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
=head1 INSTALLATION |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
Install podchecker from CPAN. |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
cpanm podchecker |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
=head1 CONFIGURATION |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
This plugin accepts the following configuration options: |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
=head2 warnings |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
The level of warnings to consider as errors - 1 or 2. By default, warnings will |
84
|
|
|
|
|
|
|
be ignored. |
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
=head1 SUPPORT |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
Bugs may be submitted at L<https://github.com/houseabsolute/perl-code-tidyall/issues>. |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
=head1 SOURCE |
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
The source code repository for Code-TidyAll can be found at L<https://github.com/houseabsolute/perl-code-tidyall>. |
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
=head1 AUTHORS |
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
=over 4 |
97
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
=item * |
99
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
Jonathan Swartz <swartz@pobox.com> |
101
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
=item * |
103
|
|
|
|
|
|
|
|
104
|
|
|
|
|
|
|
Dave Rolsky <autarch@urth.org> |
105
|
|
|
|
|
|
|
|
106
|
|
|
|
|
|
|
=back |
107
|
|
|
|
|
|
|
|
108
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
109
|
|
|
|
|
|
|
|
110
|
|
|
|
|
|
|
This software is copyright (c) 2011 - 2022 by Jonathan Swartz. |
111
|
|
|
|
|
|
|
|
112
|
|
|
|
|
|
|
This is free software; you can redistribute it and/or modify it under |
113
|
|
|
|
|
|
|
the same terms as the Perl 5 programming language system itself. |
114
|
|
|
|
|
|
|
|
115
|
|
|
|
|
|
|
The full text of the license can be found in the |
116
|
|
|
|
|
|
|
F<LICENSE> file included with this distribution. |
117
|
|
|
|
|
|
|
|
118
|
|
|
|
|
|
|
=cut |