File Coverage

blib/lib/Dist/Zilla/App/Command/kwalitee.pm
Criterion Covered Total %
statement 10 12 83.3
branch n/a
condition n/a
subroutine 4 4 100.0
pod n/a
total 14 16 87.5


line stmt bran cond sub pod time code
1             package Dist::Zilla::App::Command::kwalitee;
2             $Dist::Zilla::App::Command::kwalitee::VERSION = '0.03';
3 1     1   893 use 5.008003;
  1         3  
  1         67  
4 1     1   5 use strict;
  1         2  
  1         26  
5 1     1   4 use warnings;
  1         10  
  1         38  
6              
7 1     1   488 use Dist::Zilla::App -command;
  0            
  0            
8              
9             sub abstract { 'run CPANTS kwalitee check on your dist' }
10              
11             sub opt_spec {
12              
13             [
14             'core|c', 'core kwalitee tests only',
15             { default => 0 }
16             ],
17              
18             [
19             'experimental|e', 'include experimental metrics',
20             { default => 0 },
21             ],
22              
23             [
24             'verbose|v', 'request verbose output',
25             { default => 0 }
26             ],
27              
28             }
29              
30             sub execute {
31             my ($self, $opt, $arg) = @_;
32              
33             require App::CPANTS::Lint;
34             App::CPANTS::Lint->VERSION('0.03');
35              
36             my $tgz = $self->zilla->build_archive;
37             my $linter = App::CPANTS::Lint->new(experimental => $opt->experimental);
38             $linter->lint($tgz);
39             $linter->output_report;
40             }
41              
42             1;
43              
44             __END__
45              
46             =encoding UTF-8
47              
48             =head1 NAME
49              
50             Dist::Zilla::App::Command::kwalitee - calculate CPANTS kwalitee score for your dist
51              
52             =head1 SYNOPSIS
53              
54             dzil kwalitee [ --core | -c ] [ --experimental | -e ]
55             [ --verbose | -v ]
56              
57             =head1 DESCRIPTION
58              
59             This command is a thin wrapper around the functionality in
60             L<App::CPANTS::Lint>, which is itself a wrapper around functionality in
61             L<Module::CPANTS::Analyse>.
62              
63             From within the top directory of your distribution you can run:
64              
65             % dzil kwalitee
66              
67             Which saves you from having to run:
68              
69             % dzil build
70             % cpants_lint.pl <tarball>
71              
72             You might argue that if you're "doing Dist::Zilla right",
73             then you shouldn't need to run `cpants_lint.pl`,
74             but when I'm adopting distributions and switching them to Dist::Zilla
75             I find myself running the two commands above.
76              
77             =head1 SEE ALSO
78              
79             L<App::CPANTS::Lint> does the actual work of this command.
80             It is the core of the L<cpants_lint.pl> script.
81              
82             L<Module::CPANTS::Analyse> is the module behind L<App::CPANTS::Lint>,
83             which actually does the analysis.
84              
85             L<Dist::Zilla::Plugin::Test::Kwalitee> is a plugin that generates a
86             release test using L<Test::Kwalitee>.
87              
88             L<CPANTS|http://cpants.cpanauthors.org> is the website where you
89             can see the Kwalitee score for all distributions on CPAN.
90             As a CPAN author you can see a dashboard for all your dists.
91             For example, my PAUSE id is NEILB, so my dashboard is at:
92              
93             http://cpants.cpanauthors.org/author/NEILB
94              
95             =head1 AUTHOR
96              
97             Neil Bowers E<lt>neilb@cpan.orgE<gt>
98              
99             =head1 COPYRIGHT AND LICENSE
100              
101             This software is copyright (c) 2014 by Neil Bowers <neilb@cpan.org>.
102              
103             This is free software; you can redistribute it and/or modify it under
104             the same terms as the Perl 5 programming language system itself.
105              
106             =cut
107