Dist/Zilla/PluginBundle/YANICK.pm

filter: Statementstmt 45.2% 24 / 53 Branchbran 0.0% 0 / 8 Conditioncond 0.0% 0 / 15 MC/DCmcdc 0.0% 0 / 8 Subroutinesub 60.0% 6 / 10 Podpod 0.0% 0 / 2 totaltotal 31.2% 30 / 96 CC 12 SCAR 42.5
CC
12
Cov
32%
configure
132.0
__ANON__
6.0
version_range
2.0
CRAP 70.2
↑ Summary auto/share/module/Dist-Zilla-MintingProfile-Author-YANICK/default/Module.pm »
1 package Dist::Zilla::PluginBundle::YANICK;
2 1 our $AUTHORITY = 'cpan:YANICK';
3 1 $Dist::Zilla::PluginBundle::YANICK::VERSION = '0.32.2';
4 # ABSTRACT: Be like Yanick when you build your dists
5  
6 # [TODO] add CONTRIBUTING file
7  
8  
9 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11 1 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
12  
13 1 ▶use Dist::Zilla;
Subroutine BEGIN: called CC=1 SCAR=0.0
14  
15 1 ▶use experimental 'postderef';
Subroutine BEGIN: called CC=1 SCAR=0.0
16  
17 1 with qw/
18 Dist::Zilla::Role::PluginBundle::Easy
19 Dist::Zilla::Role::PluginBundle::Config::Slicer
20 /;
21  
22 has "doap_changelog" => (
23 isa => 'Bool',
24 is => 'ro',
25 lazy => 1,
26 0 ▶ default => sub {
Subroutine __ANON__: not called CC=2 SCAR=17.9
27 0 my $self = shift;
28  
29 0 ▶ $self->payload->{doap_changelog} //= 1;
Condition0%0/2
$self->payload->{"doap_changelog"} //= 1
l!l
00
MC/DC0%0/1
$self->payload->{"doap_changelog"} //= 1
$self->payload->{"doap_changelog"}
Truth table0%0/2
A
A= $self->payload->{"doap_changelog"}
Aresult
11
00
30 },
31 1 );
32  
33  
34  
35  
36  
37  
38 1 ▶use Type::Tiny;
Subroutine BEGIN: called CC=1 SCAR=0.0
39 1 ▶use Types::Standard qw/ Str ArrayRef /;
Subroutine BEGIN: called CC=1 SCAR=0.0
40  
41  
42 0 ▶sub version_range {
Subroutine version_range: not called CC=1 SCAR=6.9
Pod undocumented
43 0 my( $from, $to ) = @_;
44 0 return join ',', grep { not $_ % 2 } $from..$to;
45 }
46  
47 has badge => (
48 isa => 'ArrayRef',
49 is => 'ro',
50 0 ▶ default => sub { [] },
Subroutine __ANON__: not called CC=1 SCAR=6.9
51 1 );
52  
53 0 ▶sub configure {
Subroutine configure: not called CC=11 SCAR=48.8
Pod undocumented
54 0 my ( $self ) = @_;
55 0 my $arg = $self->payload;
56  
57 0 ▶ my $release_branch = $arg->{release_branch} || 'releases';
Condition0%0/2
$arg->{'release_branch'} || 'releases'
l!l
00
MC/DC0%0/1
$arg->{'release_branch'} || 'releases'
$arg->{'release_branch'}
Truth table0%0/2
A
A= $arg->{'release_branch'}
Aresult
11
00
58 0 ▶ my $dev_branch = $arg->{dev_branch} || 'main';
Condition0%0/2
$arg->{'dev_branch'} || 'main'
l!l
00
MC/DC0%0/1
$arg->{'dev_branch'} || 'main'
$arg->{'dev_branch'}
Truth table0%0/2
A
A= $arg->{'dev_branch'}
Aresult
11
00
59 0 ▶ my $upstream = $arg->{upstream} || 'github';
Condition0%0/2
$arg->{'upstream'} || 'github'
l!l
00
MC/DC0%0/1
$arg->{'upstream'} || 'github'
$arg->{'upstream'}
Truth table0%0/2
A
A= $arg->{'upstream'}
Aresult
11
00
60  
61 0 ▶ my @import_from_build = $arg->{import_from_build} ? split( ',', $arg->{import_from_build} ) :
Branch: 1 branch
BranchTrueFalseTotal
$arg->{'import_from_build'} ? : 0 0 0
62 qw/ cpanfile AUTHOR_PLEDGE CODE_OF_CONDUCT.md CONTRIBUTING.md /;
63  
64 0 my %mb_args;
65 0 ▶ $mb_args{mb_class} = $arg->{mb_class} if $arg->{mb_class};
Branch: 1 branch
BranchTrueFalseTotal
if $arg->{"mb_class"} 0 0 0
66  
67 0 ▶ my $builder = $arg->{builder} || 'MakeMaker';
Condition0%0/2
$arg->{'builder'} || 'MakeMaker'
l!l
00
MC/DC0%0/1
$arg->{'builder'} || 'MakeMaker'
$arg->{'builder'}
Truth table0%0/2
A
A= $arg->{'builder'}
Aresult
11
00
68  
69 0 $self->add_plugins([ $builder, ( \%mb_args ) x ($builder eq 'ModuleBuild' ) ]);
70  
71 $self->add_plugins(
72 qw/
73 =Dist::Zilla::PluginBundle::YANICK::Contributing
74 Git::Contributors
75 ContributorsFile
76 Test::Compile
77 CoalescePod
78 InstallGuide
79 Covenant
80 ContributorCovenant
81 /,
82 [ GithubMeta => {
83 remote => $upstream,
84 issues => 1,
85 } ],
86 qw/ MetaYAML MetaJSON PodWeaver License
87 /,
88 [ ReadmeAnyFromPod => { type => 'gfm', filename => 'README.mkdn' } ],
89 [ CoderwallEndorse => { users => 'yanick:Yanick' } ],
90 [ NextRelease => {
91 time_zone => 'America/Montreal',
92 format => '%-9v %{yyyy-MM-dd}d',
93 } ],
94 'MetaProvides::Package',
95 'MatchManifest',
96 qw/ ManifestSkip /,
97 [ 'Git::GatherDir' => {
98 include_dotfiles => $arg->{include_dotfiles},
99 exclude_filename => [ @import_from_build ],
100 } ],
101 [ CopyFilesFromBuild => { copy => [ @import_from_build ] } ],
102 qw/ ExecDir
103 PkgVersion /,
104 [ Authority => {
105 authority => $arg->{authority} // 'cpan:YANICK'
106 } ],
107 qw/ Test::ReportPrereqs
108 Signature /,
109 [ AutoPrereqs => {
110 ( skip => $arg->{autoprereqs_skip} )
111 x !!$arg->{autoprereqs_skip}
112 }
113 0 ▶ ],
Condition0%0/2
$arg->{"authority"} // "cpan:YANICK"
l!l
00
MC/DC0%0/1
$arg->{"authority"} // "cpan:YANICK"
$arg->{"authority"}
Truth table0%0/2
A
A= $arg->{"authority"}
Aresult
11
00
114 qw/ CheckChangesHasContent
115 TestRelease
116 ConfirmRelease
117 Git::Check
118 CopyrightYearFromGit
119 /,
120 [ 'Git::CommitBuild' => {
121 release_branch => $release_branch ,
122 multiple_inheritance => 1,
123 } ],
124 [ 'Git::Tag' => { tag_format => 'v%v', branch => $release_branch } ],
125 );
126  
127  
128 # Git::Commit can't be before Git::CommitBuild :-/
129 0 $self->add_plugins(
130 'PreviousVersion::Changelog',
131 [ 'NextVersion::Semantic' => {
132 major => 'API CHANGES',
133 minor => 'NEW FEATURES, ENHANCEMENTS',
134 revision => 'BUG FIXES, DOCUMENTATION, STATISTICS',
135 } ],
136 [ 'ChangeStats::Git' => {
137 group => 'STATISTICS',
138 develop_branch => $dev_branch,
139 release_branch => $release_branch,
140 } ],
141 'Git::Commit',
142 );
143  
144 0 ▶ if ( $ENV{FAKE} or $arg->{fake_release} ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($ENV{'FAKE'} or $arg->{'fake_release'}) { } 0 0 0
Condition0%0/3
$ENV{"FAKE"} or $arg->{"fake_release"}
l!l&&r!l&&!r
000
MC/DC0%0/2
$ENV{"FAKE"} or $arg->{"fake_release"}
$ENV{"FAKE"} $arg->{"fake_release"}
Truth table0%0/3
A or B
A= $ENV{"FAKE"}B= $arg->{"fake_release"}
ABresult
1X1
011
000
145 0 $self->add_plugins( 'FakeRelease' );
146 }
147 else {
148 0 $self->add_plugins(
149 [ 'Git::Push' => { push_to => join ' ', $upstream, $dev_branch, $release_branch} ],
150 qw/ UploadToCPAN /,
151 );
152  
153 0 $self->add_plugins(
154 [ 'InstallRelease' => { install_command => 'cpanm .' } ],
155 );
156 }
157  
158 0 $self->add_plugins(
159 qw/
160 SchwartzRatio
161 Test::UnusedVars
162 RunExtraTests
163 /
164 );
165  
166 0 ▶ if ( my $help_wanted = $arg->{help_wanted} ) {
Branch: 1 branch
BranchTrueFalseTotal
if (my $help_wanted = $arg->{"help_wanted"}) 0 0 0
167 $self->add_plugins([
168 'HelpWanted' => {
169 0 map { $_ => 1 } split ' ', $help_wanted
170 },
171 ]);
172 }
173  
174 $self->add_plugins(
175 0 [ DOAP => {
176 process_changes => $self->doap_changelog,
177 # ttl_filename => 'project.ttl',
178 } ],
179 'CPANFile',
180 [ SecurityPolicy => {
181 -policy => 'Individual',
182 timeframe => '1 month',
183 perl_support_years => 5,
184 } ],
185 );
186  
187 0 $self->config_slice( 'mb_class' );
188  
189 0 return;
190 }
191  
192 1 1;
193  
194 __END__
↑ Summary auto/share/module/Dist-Zilla-MintingProfile-Author-YANICK/default/Module.pm »