Dist/Zilla/PluginBundle/DAGOLDEN.pm

filter: Statementstmt 98.7% 159 / 161 Branchbran 42.6% 35 / 82 Conditioncond 33.3% 4 / 12 MC/DCmcdc 0.0% 0 / 5 Subroutinesub 96.5% 56 / 58 Podpod 0.0% 0 / 1 totaltotal 79.6% 254 / 319 CC 46 SCAR 42.4
CC
46
Cov
78%
configure
212.2
__ANON__
6.0
__ANON__
6.0
CRAP 69.1
↑ Summary Pod/Weaver/PluginBundle/DAGOLDEN.pm »
1 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
2 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
3  
4 package Dist::Zilla::PluginBundle::DAGOLDEN;
5 # ABSTRACT: Dist::Zilla configuration the way DAGOLDEN does it
6  
7 1 our $VERSION = '0.079';
8  
9 # Dependencies
10 1 ▶use Moose 0.99;
Subroutine BEGIN: called CC=1 SCAR=0.0
11 1 ▶use namespace::autoclean 0.09;
Subroutine BEGIN: called CC=1 SCAR=0.0
12  
13 1 ▶use Dist::Zilla 5.014; # default_jobs
Subroutine BEGIN: called CC=1 SCAR=0.0
14  
15 1 ▶use Dist::Zilla::PluginBundle::Filter ();
Subroutine BEGIN: called CC=1 SCAR=0.0
16 1 ▶use Dist::Zilla::PluginBundle::Git 1.121010 ();
Subroutine BEGIN: called CC=1 SCAR=0.0
17  
18 1 ▶use Dist::Zilla::Plugin::Authority 1.006 ();
Subroutine BEGIN: called CC=1 SCAR=0.0
19 1 ▶use Dist::Zilla::Plugin::Bugtracker 1.110 ();
Subroutine BEGIN: called CC=1 SCAR=0.0
20 1 ▶use Dist::Zilla::Plugin::BumpVersionAfterRelease 0.003 (); # tweak Makefile.PL
Subroutine BEGIN: called CC=1 SCAR=0.0
21 1 ▶use Dist::Zilla::Plugin::CheckChangesHasContent ();
Subroutine BEGIN: called CC=1 SCAR=0.0
22 1 ▶use Dist::Zilla::Plugin::RunExtraTests ();
Subroutine BEGIN: called CC=1 SCAR=0.0
23 1 ▶use Dist::Zilla::Plugin::CheckMetaResources 0.001 ();
Subroutine BEGIN: called CC=1 SCAR=0.0
24 1 ▶use Dist::Zilla::Plugin::CheckPrereqsIndexed 0.002 ();
Subroutine BEGIN: called CC=1 SCAR=0.0
25 1 ▶use Dist::Zilla::Plugin::Git::Contributors 0.007 ();
Subroutine BEGIN: called CC=1 SCAR=0.0
26 1 ▶use Dist::Zilla::Plugin::CopyFilesFromBuild::Filtered ();
Subroutine BEGIN: called CC=1 SCAR=0.0
27 1 ▶use Dist::Zilla::Plugin::CPANFile ();
Subroutine BEGIN: called CC=1 SCAR=0.0
28 1 ▶use Dist::Zilla::Plugin::Git::NextVersion ();
Subroutine BEGIN: called CC=1 SCAR=0.0
29 1 ▶use Dist::Zilla::Plugin::Git::CheckFor::CorrectBranch ();
Subroutine BEGIN: called CC=1 SCAR=0.0
30 1 ▶use Dist::Zilla::Plugin::GithubMeta 0.36 ();
Subroutine BEGIN: called CC=1 SCAR=0.0
31 1 ▶use Dist::Zilla::Plugin::InsertCopyright 0.001 ();
Subroutine BEGIN: called CC=1 SCAR=0.0
32 1 ▶use Dist::Zilla::Plugin::MetaNoIndex ();
Subroutine BEGIN: called CC=1 SCAR=0.0
33 1 ▶use Dist::Zilla::Plugin::MetaProvides::Package 1.14 (); # hides private packages
Subroutine BEGIN: called CC=1 SCAR=0.0
34 1 ▶use Dist::Zilla::Plugin::MinimumPerl ();
Subroutine BEGIN: called CC=1 SCAR=0.0
35 1 ▶use Dist::Zilla::Plugin::SurgicalPodWeaver ();
Subroutine BEGIN: called CC=1 SCAR=0.0
36 1 ▶use Dist::Zilla::Plugin::PromptIfStale 0.011 ();
Subroutine BEGIN: called CC=1 SCAR=0.0
37 1 ▶use Dist::Zilla::Plugin::Prereqs::AuthorDeps ();
Subroutine BEGIN: called CC=1 SCAR=0.0
38 1 ▶use Dist::Zilla::Plugin::RewriteVersion ();
Subroutine BEGIN: called CC=1 SCAR=0.0
39 1 ▶use Dist::Zilla::Plugin::Pod2Readme ();
Subroutine BEGIN: called CC=1 SCAR=0.0
40 1 ▶use Dist::Zilla::Plugin::TaskWeaver 0.101620 ();
Subroutine BEGIN: called CC=1 SCAR=0.0
41 1 ▶use Dist::Zilla::Plugin::Test::Compile 2.036 (); # various features
Subroutine BEGIN: called CC=1 SCAR=0.0
42 1 ▶use Dist::Zilla::Plugin::Test::MinimumVersion 2.000003 ();
Subroutine BEGIN: called CC=1 SCAR=0.0
43 1 ▶use Dist::Zilla::Plugin::Test::Perl::Critic ();
Subroutine BEGIN: called CC=1 SCAR=0.0
44 1 ▶use Dist::Zilla::Plugin::Test::PodSpelling 2.006001 (); # Pod::Wordlist
Subroutine BEGIN: called CC=1 SCAR=0.0
45 1 ▶use Test::Portability::Files 0.06 (); # buggy before that
Subroutine BEGIN: called CC=1 SCAR=0.0
46 1 ▶use Dist::Zilla::Plugin::Test::Portability ();
Subroutine BEGIN: called CC=1 SCAR=0.0
47 1 ▶use Dist::Zilla::Plugin::Test::ReportPrereqs 0.016 (); # better reporting & bug fixes
Subroutine BEGIN: called CC=1 SCAR=0.0
48 1 ▶use Dist::Zilla::Plugin::Test::Version ();
Subroutine BEGIN: called CC=1 SCAR=0.0
49  
50 1 with qw(
51 Dist::Zilla::Role::PluginBundle::Easy
52 Dist::Zilla::Role::PluginBundle::Config::Slicer
53 Dist::Zilla::Role::PluginBundle::PluginRemover
54 );
55  
56 1 ▶sub mvp_multivalue_args { qw/stopwords/ }
Subroutine mvp_multivalue_args: called CC=1 SCAR=0.0
57  
58 has stopwords => (
59 is => 'ro',
60 isa => 'Maybe[ArrayRef]',
61 lazy => 1,
62 1 ▶ default => sub {
Subroutine __ANON__: called CC=2 SCAR=7.6
63 1 ▶ exists $_[0]->payload->{stopwords} ? $_[0]->payload->{stopwords} : undef;
Branch: 1 branch
BranchTrueFalseTotal
exists $_[0]->payload->{'stopwords'} ? : 0 1 1
64 },
65 1 );
66  
67 has fake_release => (
68 is => 'ro',
69 isa => 'Bool',
70 lazy => 1,
71 1 ▶ default => sub { $_[0]->payload->{fake_release} },
Subroutine __ANON__: called CC=1 SCAR=0.0
72 1 );
73  
74 has no_git => (
75 is => 'ro',
76 isa => 'Bool',
77 lazy => 1,
78 1 ▶ default => sub { $_[0]->payload->{no_git} },
Subroutine __ANON__: called CC=1 SCAR=0.0
79 1 );
80  
81 has no_copy_files => (
82 is => 'ro',
83 isa => 'Bool',
84 lazy => 1,
85 1 ▶ default => sub { $_[0]->payload->{no_copy_files} },
Subroutine __ANON__: called CC=1 SCAR=0.0
86 1 );
87  
88 has no_critic => (
89 is => 'ro',
90 isa => 'Bool',
91 lazy => 1,
92 1 ▶ default => sub {
Subroutine __ANON__: called CC=2 SCAR=7.6
93 1 ▶ exists $_[0]->payload->{no_critic} ? $_[0]->payload->{no_critic} : 0;
Branch: 1 branch
BranchTrueFalseTotal
exists $_[0]->payload->{'no_critic'} ? : 0 1 1
94 },
95 1 );
96  
97 has no_spellcheck => (
98 is => 'ro',
99 isa => 'Bool',
100 lazy => 1,
101 1 ▶ default => sub {
Subroutine __ANON__: called CC=2 SCAR=7.6
102 exists $_[0]->payload->{no_spellcheck}
103 ? $_[0]->payload->{no_spellcheck}
104 1 ▶ : 0;
Branch: 1 branch
BranchTrueFalseTotal
exists $_[0]->payload->{'no_spellcheck'} ? : 0 1 1
105 },
106 1 );
107  
108 has no_coverage => (
109 is => 'ro',
110 isa => 'Bool',
111 lazy => 1,
112 1 ▶ default => sub {
Subroutine __ANON__: called CC=2 SCAR=7.6
113 exists $_[0]->payload->{no_coverage}
114 ? $_[0]->payload->{no_coverage}
115 1 ▶ : 0;
Branch: 1 branch
BranchTrueFalseTotal
exists $_[0]->payload->{'no_coverage'} ? : 0 1 1
116 },
117 1 );
118  
119 has no_minimum_perl => (
120 is => 'ro',
121 isa => 'Bool',
122 lazy => 1,
123 1 ▶ default => sub {
Subroutine __ANON__: called CC=2 SCAR=7.6
124 exists $_[0]->payload->{no_minimum_perl}
125 ? $_[0]->payload->{no_minimum_perl}
126 1 ▶ : 0;
Branch: 1 branch
BranchTrueFalseTotal
exists $_[0]->payload->{'no_minimum_perl'} ? : 0 1 1
127 },
128 1 );
129  
130 has is_task => (
131 is => 'ro',
132 isa => 'Bool',
133 lazy => 1,
134 1 ▶ default => sub { $_[0]->payload->{is_task} },
Subroutine __ANON__: called CC=1 SCAR=0.0
135 1 );
136  
137 has auto_prereq => (
138 is => 'ro',
139 isa => 'Bool',
140 lazy => 1,
141 1 ▶ default => sub {
Subroutine __ANON__: called CC=2 SCAR=7.6
142 1 ▶ exists $_[0]->payload->{auto_prereq} ? $_[0]->payload->{auto_prereq} : 1;
Branch: 1 branch
BranchTrueFalseTotal
exists $_[0]->payload->{'auto_prereq'} ? : 0 1 1
143 },
144 1 );
145  
146 has tag_format => (
147 is => 'ro',
148 isa => 'Str',
149 lazy => 1,
150 0 ▶ default => sub {
Subroutine __ANON__: not called CC=2 SCAR=17.9
151 0 ▶ exists $_[0]->payload->{tag_format} ? $_[0]->payload->{tag_format} : 'release-%v',;
Branch: 1 branch
BranchTrueFalseTotal
exists $_[0]->payload->{'tag_format'} ? : 0 0 0
152 },
153 1 );
154  
155 has version_regexp => (
156 is => 'ro',
157 isa => 'Str',
158 lazy => 1,
159 0 ▶ default => sub {
Subroutine __ANON__: not called CC=2 SCAR=17.9
160 exists $_[0]->payload->{version_regexp}
161 ? $_[0]->payload->{version_regexp}
162 0 ▶ : '^release-(.+)$',
Branch: 1 branch
BranchTrueFalseTotal
exists $_[0]->payload->{'version_regexp'} ? : 0 0 0
163 ;
164 },
165 1 );
166  
167 has weaver_config => (
168 is => 'ro',
169 isa => 'Str',
170 lazy => 1,
171 1 ▶ default => sub { $_[0]->payload->{weaver_config} || '@DAGOLDEN' },
Subroutine __ANON__: called CC=2 SCAR=7.6
Branch: 1 branch
BranchTrueFalseTotal
$_[0]->payload->{"weaver_config"} or "\@DAGOLDEN" 0 1 1
172 1 );
173  
174 has github_issues => (
175 is => 'ro',
176 isa => 'Str',
177 lazy => 1,
178 1 ▶ default => sub {
Subroutine __ANON__: called CC=2 SCAR=7.6
179 1 ▶ exists $_[0]->payload->{github_issues} ? $_[0]->payload->{github_issues} : 1;
Branch: 1 branch
BranchTrueFalseTotal
exists $_[0]->payload->{'github_issues'} ? : 0 1 1
180 },
181 1 );
182  
183 has git_remote => (
184 is => 'ro',
185 isa => 'Str',
186 lazy => 1,
187 1 ▶ default => sub {
Subroutine __ANON__: called CC=2 SCAR=7.6
188 1 ▶ exists $_[0]->payload->{git_remote} ? $_[0]->payload->{git_remote} : 'origin',;
Branch: 1 branch
BranchTrueFalseTotal
exists $_[0]->payload->{'git_remote'} ? : 0 1 1
189 },
190 1 );
191  
192 has authority => (
193 is => 'ro',
194 isa => 'Str',
195 lazy => 1,
196 1 ▶ default => sub {
Subroutine __ANON__: called CC=2 SCAR=7.6
197 1 ▶ exists $_[0]->payload->{authority} ? $_[0]->payload->{authority} : 'cpan:DAGOLDEN';
Branch: 1 branch
BranchTrueFalseTotal
exists $_[0]->payload->{'authority'} ? : 0 1 1
198 },
199 1 );
200  
201 has darkpan => (
202 is => 'ro',
203 isa => 'Bool',
204 lazy => 1,
205 1 ▶ default => sub {
Subroutine __ANON__: called CC=2 SCAR=7.6
206 1 ▶ exists $_[0]->payload->{darkpan} ? $_[0]->payload->{darkpan} : 0;
Branch: 1 branch
BranchTrueFalseTotal
exists $_[0]->payload->{'darkpan'} ? : 0 1 1
207 },
208 1 );
209  
210 1 has no_bugtracker => ( # XXX deprecated
211 is => 'ro',
212 isa => 'Bool',
213 lazy => 1,
214 default => 0,
215 );
216  
217 has auto_version => (
218 is => 'ro',
219 isa => 'Bool',
220 lazy => 1,
221 1 ▶ default => sub { $_[0]->payload->{auto_version} },
Subroutine __ANON__: called CC=1 SCAR=0.0
222 1 );
223  
224 1 ▶sub configure {
Subroutine configure: called CC=33 SCAR=53.6
Pod undocumented
225 1 my $self = shift;
226  
227 1 my @push_to = ('origin');
228 1 ▶ push @push_to, $self->git_remote if $self->git_remote ne 'origin';
Branch: 1 branch
BranchTrueFalseTotal
if $self->git_remote ne "origin" 0 1 1
229  
230 $self->add_plugins(
231  
232 # version number
233 ( $self->auto_version ? 'AutoVersion' : 'RewriteVersion' ),
234  
235 # gather and prune
236 (
237 $self->no_git
238 ? [ 'GatherDir' => { exclude_filename => [qw/README.mkdn cpanfile Makefile.PL/] }
239 ] # core
240 : [
241 'Git::GatherDir' => { exclude_filename => [qw/README.mkdn cpanfile Makefile.PL/] }
242 ]
243 ),
244 'PruneCruft', # core
245 'ManifestSkip', # core
246  
247 # file munging
248 ( $self->auto_version ? 'PkgVersion' : () ),
249 'InsertCopyright',
250 (
251 $self->is_task
252 ? 'TaskWeaver'
253 : [
254 'SurgicalPodWeaver' => {
255 config_plugin => $self->weaver_config,
256 replacer => 'replace_with_comment',
257 post_code_replacer => 'replace_with_nothing',
258 }
259 ]
260 ),
261  
262 # generated distribution files
263 'Pod2Readme', # in build dir
264 'License', # core
265  
266 # generated t/ tests
267 [
268 'Test::Compile' => {
269 fake_home => 1,
270 xt_mode => 1,
271 }
272 ],
273 (
274 $self->no_minimum_perl
275 ? ()
276 : [ 'Test::MinimumVersion' => { max_target_perl => '5.010' } ]
277 ),
278 'Test::ReportPrereqs',
279  
280 # generated xt/ tests
281 (
282 $self->no_spellcheck ? ()
283 : [
284 'Test::PodSpelling' => $self->stopwords ? { stopwords => $self->stopwords } : ()
285 ]
286 ),
287 (
288 $self->no_critic ? ()
289 : ('Test::Perl::Critic')
290 ),
291 'MetaTests', # core
292 'PodSyntaxTests', # core
293 (
294 $self->no_coverage
295 ? ()
296 : ('PodCoverageTests') # core
297 ),
298 [ 'Test::Portability' => { options => "test_one_dot = 0" } ],
299 'Test::Version',
300  
301 # metadata
302 [
303 'Authority' => {
304 authority => $self->authority,
305 do_munging => 0,
306 }
307 ],
308 'MinimumPerl',
309 (
310 $self->auto_prereq
311 ? [ 'AutoPrereqs' => { skip => "^t::lib" } ]
312 : ()
313 ),
314 [
315 MetaNoIndex => {
316 directory => [qw/t xt examples corpus/],
317 'package' => [qw/DB/]
318 }
319 ],
320 [ 'MetaProvides::Package' => { meta_noindex => 1 } ], # AFTER MetaNoIndex
321 (
322 $self->darkpan
323 ? ()
324 : [
325 GithubMeta => {
326 remote => [qw(origin github)],
327 issues => $self->github_issues,
328 }
329 ],
330 ),
331 (
332 ( $self->no_git || $self->darkpan || !$self->github_issues ) ? (
333 # fake out Pod::Weaver::Section::Support
334 [
335 'Bugtracker' =>
336 { mailto => '', $self->darkpan ? ( web => "http://localhost/" ) : () }
337 ],
338 )
339 : ()
340 ),
341 (
342 ( $self->no_git || $self->darkpan )
343 ? (
344 # fake out Pod::Weaver::Section::Support
345 [
346 1 ▶ 'MetaResources' => { map { ; "repository.$_" => "http://localhost/" } qw/url web/ }
Branch: 27 branches
BranchTrueFalseTotal
$self->auto_version ? : 0 1 1
$self->no_git ? : 1 0 1
$self->auto_version ? : 0 1 1
$self->is_task ? : 0 1 1
$self->no_minimum_perl ? : 0 1 1
$self->no_spellcheck ? : 0 1 1
$self->stopwords ? : 0 1 1
$self->no_critic ? : 0 1 1
$self->no_coverage ? : 0 1 1
$self->auto_prereq ? : 1 0 1
$self->darkpan ? : 0 1 1
$self->no_git || $self->darkpan || !$self->github_issues ? : 1 0 1
$self->darkpan ? : 0 1 1
$self->no_git || $self->darkpan ? : 1 0 1
$self->no_git ? : 1 0 1
$self->no_copy_files ? : 0 1 1
$self->auto_version ? : 0 1 1
$self->no_git ? : 1 0 1
$self->no_git ? : 1 0 1
$self->auto_version ? : 0 0 0
$self->fake_release || $self->darkpan ? : 0 1 1
$self->no_git ? : 1 0 1
$self->auto_version ? : 0 0 0
$self->auto_version ? : 0 0 0
$self->auto_version ? : 0 1 1
$self->no_git ? : 1 0 1
$self->auto_version ? : 0 0 0
Condition33%4/12
$self->no_git or $self->darkpan or not $self->github_issues
l!l&&r!l&&!r
100
$self->no_git or $self->darkpan
l!l&&r!l&&!r
100
$self->no_git or $self->darkpan
l!l&&r!l&&!r
100
$self->fake_release or $self->darkpan
l!l&&r!l&&!r
001
MC/DC0%0/3
$self->no_git or $self->darkpan or not $self->github_issues
$self->no_git $self->darkpan not $self->github_issues
MC/DC0%0/2
$self->fake_release or $self->darkpan
$self->fake_release $self->darkpan
Truth table25%1/4
A or B or not(C)
A= $self->no_gitB= $self->darkpanC= not $self->github_issues
ABCresult
1XX1
01X1
0011
0000
Truth table33%1/3
A or B
A= $self->fake_releaseB= $self->darkpan
ABresult
1X1
011
000
347 ],
348 )
349 : ()
350 ),
351 # contributors
352 (
353 $self->no_git
354 ? ()
355 : 'Git::Contributors'
356 ),
357  
358 'Prereqs::AuthorDeps',
359 'MetaYAML', # core
360 'MetaJSON', # core
361 'CPANFile',
362  
363 # build system
364 'ExecDir', # core
365 'ShareDir', # core
366 [ 'MakeMaker' => { eumm_version => '6.17', default_jobs => 9 } ], # core
367  
368 # are we up to date?
369 [
370 'PromptIfStale' => {
371 modules => [qw/Dist::Zilla Dist::Zilla::PluginBundle::DAGOLDEN/],
372 check_all_plugins => 1,
373 }
374 ],
375  
376 # copy files from build back to root for inclusion in VCS;
377 # for auto_version we want cpanfile. For embedded version we want Makefile.PL
378 (
379 $self->no_copy_files
380 ? ()
381 : (
382 [
383 'CopyFilesFromBuild::Filtered' =>
384 { copy => $self->auto_version ? 'cpanfile' : 'Makefile.PL' }
385 ]
386 )
387 ),
388  
389 # manifest -- must come after all generated files
390 'Manifest', # core
391  
392 # before release
393 (
394 $self->no_git ? ()
395 : ('Git::CheckFor::CorrectBranch')
396 ),
397 (
398 $self->no_git ? ()
399 : [
400 'Git::Check' =>
401 { allow_dirty => [ $self->auto_version ? 'cpanfile' : 'Makefile.PL' ] }
402 ]
403 ),
404 'CheckMetaResources',
405 'CheckPrereqsIndexed',
406 'CheckChangesHasContent',
407 [ 'RunExtraTests' => { default_jobs => 9 } ],
408 'TestRelease', # core
409 'ConfirmRelease', # core
410  
411 # release
412 ( $self->fake_release || $self->darkpan ? 'FakeRelease' : 'UploadToCPAN' ), # core
413  
414 # after release
415 # Note -- NextRelease is here to get the ordering right with
416 # git actions. It is *also* a file munger that acts earlier
417  
418 (
419 $self->no_git
420 ? ()
421 : (
422 [
423 'Git::Commit' => 'Commit_Dirty_Files' => {
424 commit_msg => "Update " . ( $self->auto_version ? 'cpanfile' : 'Makefile.PL' ),
425 allow_dirty => [ $self->auto_version ? 'cpanfile' : 'Makefile.PL' ]
426 }
427 ],
428 [ 'Git::Tag' => { tag_format => $self->tag_format } ],
429 )
430 ),
431  
432 # bumps Changes
433 'NextRelease', # core (also munges files)
434  
435 # bumps $VERSION, maybe
436 ( $self->auto_version ? () : 'BumpVersionAfterRelease' ),
437  
438 (
439 $self->no_git ? ()
440 : (
441 [
442 'Git::Commit' => 'Commit_Changes' => {
443 $self->auto_version ? ( commit_msg => "After release: timestamp Changes" )
444 : (
445 commit_msg => "After release: bump \$VERSION and timestamp Changes",
446 allow_dirty => [qw/Changes Makefile.PL/],
447 allow_dirty_match => '^lib',
448 )
449 }
450 ],
451 [ 'Git::Push' => { push_to => \@push_to } ],
452 )
453 ),
454  
455 );
456  
457 }
458  
459 1 __PACKAGE__->meta->make_immutable;
460  
461 1 1;
462  
463 #
464 # This file is part of Dist-Zilla-PluginBundle-DAGOLDEN
465 #
466 # This software is Copyright (c) 2018 by David Golden.
467 #
468 # This is free software, licensed under:
469 #
470 # The Apache License, Version 2.0, January 2004
471 #
472  
473 __END__
↑ Summary Pod/Weaver/PluginBundle/DAGOLDEN.pm »