File Coverage

blib/lib/Dist/Zilla/App/Command/kwalitee.pm
Criterion Covered Total %
statement 11 20 55.0
branch n/a
condition n/a
subroutine 4 7 57.1
pod 3 3 100.0
total 18 30 60.0


line stmt bran cond sub pod time code
1             package Dist::Zilla::App::Command::kwalitee;
2             $Dist::Zilla::App::Command::kwalitee::VERSION = '0.04';
3 1     1   833 use 5.008003;
  1         4  
4 1     1   5 use strict;
  1         2  
  1         20  
5 1     1   6 use warnings;
  1         2  
  1         51  
6              
7 1     1   544 use Dist::Zilla::App -command;
  1         68962  
  1         16  
8              
9 0     0 1   sub abstract { 'run CPANTS kwalitee check on your dist' }
10              
11             sub opt_spec {
12              
13             [
14 0     0 1   '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 0     0 1   my ($self, $opt, $arg) = @_;
32              
33 0           require App::CPANTS::Lint;
34 0           App::CPANTS::Lint->VERSION('0.03');
35              
36 0           my $tgz = $self->zilla->build_archive;
37 0           my $linter = App::CPANTS::Lint->new(experimental => $opt->experimental);
38 0           $linter->lint($tgz);
39 0           $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