PluginBundle/GEEKRUTH.pm

filter: Statementstmt 36.3% 20 / 55 Branchbran 0.0% 0 / 10 Conditioncond 0.0% 0 / 15 MC/DCmcdc 0.0% 0 / 8 Subroutinesub 62.5% 5 / 8 Podpod 0.0% 0 / 2 totaltotal 25.5% 25 / 98 CC 13 SCAR 47.8
CC
13
Cov
25%
configure
182.0
version_range
2.0
__ANON__
2.0
CRAP 118.8
↑ Summary MintingProfile/GEEKRUTH.pm »
1 package Dist::Zilla::PluginBundle::GEEKRUTH;
2 1 ▶use Modern::Perl;
Subroutine BEGIN: called CC=1 SCAR=0.0
3  
4 1 our $VERSION = '6.0000'; # VERSION
5 1 our $AUTHORITY = 'cpan:GEEKRUTH'; # AUTHORITY
6  
7 # ABSTRACT: Be like GeekRuthie when you build your distributions
8  
9 1 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
10 1 ▶use Dist::Zilla;
Subroutine BEGIN: called CC=1 SCAR=0.0
11 1 with qw/
12 Dist::Zilla::Role::PluginBundle::Easy
13 Dist::Zilla::Role::PluginBundle::Config::Slicer
14 Dist::Zilla::Role::PluginBundle::PluginRemover
15 /;
16 1 ▶use Type::Tiny;
Subroutine BEGIN: called CC=1 SCAR=0.0
17 1 ▶use Types::Standard qw/ Str ArrayRef /;
Subroutine BEGIN: called CC=1 SCAR=0.0
18  
19 0 ▶sub version_range {
Subroutine version_range: not called CC=1 SCAR=6.9
Pod undocumented
20 0 my ( $from, $to ) = @_;
21 0 return join ',', grep { not $_ % 2 } $from .. $to;
22 }
23  
24 has badge => (
25 isa => 'ArrayRef',
26 is => 'ro',
27 0 ▶ default => sub { [] },
Subroutine __ANON__: not called CC=1 SCAR=6.9
28 1 );
29  
30 0 ▶sub configure {
Subroutine configure: not called CC=13 SCAR=52.0
Pod undocumented
31 0 my ($self) = @_;
32 0 my $arg = $self->payload;
33  
34 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
35 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
36 0 ▶ my $upstream = $arg->{upstream} || 'origin';
Condition0%0/2
$arg->{'upstream'} || 'origin'
l!l
00
MC/DC0%0/1
$arg->{'upstream'} || 'origin'
$arg->{'upstream'}
Truth table0%0/2
A
A= $arg->{'upstream'}
Aresult
11
00
37 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
38 0 my $help_wanted = $arg->{help_wanted};
39 0 my $builder_args = {};
40  
41 0 ▶ if ( $builder eq 'ModuleBuild' ) {
Branch: 2 branches
BranchTrueFalseTotal
if ($builder eq 'ModuleBuild') { } 0 0 0
elsif ($builder eq 'MakeMaker') { } 0 0 0
42 0 ▶ $builder_args->{mb_class} = $arg->{mb_class} if $arg->{mb_class};
Branch: 1 branch
BranchTrueFalseTotal
if $arg->{"mb_class"} 0 0 0
43 }
44 elsif ( $builder eq 'MakeMaker' ) {
45 0 ▶ $builder_args->{eumm_version} = $arg->{eumm_version} // '7.22';
Condition0%0/2
$arg->{"eumm_version"} // "7.22"
l!l
00
MC/DC0%0/1
$arg->{"eumm_version"} // "7.22"
$arg->{"eumm_version"}
Truth table0%0/2
A
A= $arg->{"eumm_version"}
Aresult
11
00
46 }
47 0 $self->config_slice(qw(mb_class eumm_version));
48  
49 # ------------------------------------------------------------------
50 # Source gathering and file selection
51 # ------------------------------------------------------------------
52  
53 0 $self->add_plugins(
54 [ 'Git::GatherDir' => {
55 exclude_filename => [
56 'Makefile.PL',
57 'Build.PL',
58 'META.json',
59 'META.yml',
60 'MANIFEST',
61 'cpanfile',
62 ],
63 },
64 ],
65 );
66 0 $self->add_plugins(
67 qw/
68 PruneCruft
69 ManifestSkip
70 ExecDir
71 /,
72 );
73  
74 # ------------------------------------------------------------------
75 # Version management
76 # ------------------------------------------------------------------
77  
78 0 $self->add_plugins(
79 'PreviousVersion::Changelog',
80 [ 'NextVersion::Semantic' => {
81 major => 'MAJOR, API CHANGES',
82 minor => 'MINOR, NEW FEATURES, ENHANCEMENTS',
83 revision => 'REVISION, BUG FIXES, DOCUMENTATION, STATISTICS',
84 format => '%d.%02d%02d',
85 }
86 ],
87 );
88  
89 # ------------------------------------------------------------------
90 # Repository integration and contributors
91 # ------------------------------------------------------------------
92  
93 0 $self->add_plugins(
94 'Codeberg::Update',
95 [ 'Codeberg::Meta' => {
96 remote => $upstream,
97 p3rl => 1,
98 metacpan => 0,
99 },
100 ],
101 qw/
102 Git::Contributors
103 ContributorsFile
104 /,
105 );
106  
107 # ------------------------------------------------------------------
108 # Distribution policies and documentation
109 # ------------------------------------------------------------------
110  
111 0 $self->add_plugins(
112 qw/
113 License
114 Covenant
115 ContributorCovenant
116 InstallGuide
117 /,
118 [ 'SecurityPolicy' => {
119 '-policy' => 'Individual',
120 },
121 ],
122 );
123  
124 0 ▶ if ($help_wanted) {
Branch: 1 branch
BranchTrueFalseTotal
if ($help_wanted) 0 0 0
125 $self->add_plugins(
126 0 [ 'HelpWanted' => { map { $_ => 1 } split q{ }, $help_wanted } ]
127 );
128 }
129  
130 # ------------------------------------------------------------------
131 # Source and POD munging
132 # ------------------------------------------------------------------
133  
134 $self->add_plugins(
135 qw/
136 OurPkgVersion
137 /,
138 [ Authority => {
139 0 ▶ authority => $arg->{authority} // 'cpan:GEEKRUTH',
Condition0%0/2
$arg->{"authority"} // "cpan:GEEKRUTH"
l!l
00
MC/DC0%0/1
$arg->{"authority"} // "cpan:GEEKRUTH"
$arg->{"authority"}
Truth table0%0/2
A
A= $arg->{"authority"}
Aresult
11
00
140 locate_comment => 1,
141 },
142 ],
143 [ TidyAll => {
144 conf_file => 'tidyall.ini',
145 }
146 ],
147 qw/
148 CopyrightYearFromGit
149 CoalescePod
150 PodWeaver
151 ReadmeMarkdownFromPod
152 /,
153 );
154  
155 # ------------------------------------------------------------------
156 # Changelog management
157 # ------------------------------------------------------------------
158  
159 0 $self->add_plugins(
160 [ 'ChangeStats::Git' => {
161 group => 'STATISTICS',
162 develop_branch => $dev_branch,
163 release_branch => $release_branch,
164 }
165 ],
166 [ NextRelease => {
167 time_zone => 'America/New_York',
168 }
169 ],
170 );
171  
172 # ------------------------------------------------------------------
173 # Prerequisites and distribution metadata
174 # ------------------------------------------------------------------
175  
176 $self->add_plugins(
177 [ AutoPrereqs => {
178 skip => 'parent',
179 ( skip => $arg->{autoprereqs_skip} )
180 x !!$arg->{autoprereqs_skip}
181 }
182 0 ],
183 [ 'MinimumPerl' => {
184 default_version => '5.028',
185 }
186 ],
187 qw/
188 Prereqs::Plugins
189 MetaProvides::Package
190 MetaData::BuiltWith
191 /,
192 );
193  
194 # ------------------------------------------------------------------
195 # Generated tests
196 # ------------------------------------------------------------------
197  
198 0 $self->add_plugins(
199 qw/
200 Test::Compile
201 Test::CVE
202 Test::EOF
203 Test::EOL
204 Test::Fixme
205 Test::Kwalitee::Extra
206 Test::MixedScripts
207 Test::NoTabs
208 Test::ReportPrereqs
209 Test::TrailingSpace
210 Test::UnusedVars
211 /,
212 [ 'Test::Perl::Critic' => {
213 critic_config => 'perlcritic.rc',
214 },
215 ],
216 [ 'Test::TidyAll' => {
217 conf_file => 'tidyall.ini',
218 },
219 ]
220 );
221  
222 # ------------------------------------------------------------------
223 # Build artifacts
224 # ------------------------------------------------------------------
225  
226 0 $self->add_plugins(
227 [ $builder, $builder_args ],
228 qw/
229 CPANFile
230 MetaYAML
231 MetaJSON
232 CycloneDX
233 INI::Baked
234 Manifest
235 /,
236 );
237  
238 # ------------------------------------------------------------------
239 # Release validation
240 # ------------------------------------------------------------------
241  
242 0 $self->add_plugins(
243 qw/
244 CheckChangesHasContent
245 Git::Check
246 SchwartzRatio
247 RunExtraTests
248 TestRelease
249 ConfirmRelease
250 /,
251 );
252  
253 # ------------------------------------------------------------------
254 # Release and repository management
255 # ------------------------------------------------------------------
256  
257 0 $self->add_plugins(
258 'Git::Commit',
259 [ 'Git::CommitBuild' => {
260 branch => '',
261 release_branch => $release_branch,
262 multiple_inheritance => 1,
263 }
264 ],
265 [ 'Git::Tag' => {
266 tag_format => 'v%v',
267 branch => $release_branch,
268 }
269 ],
270 );
271  
272 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
273 0 $self->add_plugins('FakeRelease');
274 }
275 else {
276 0 $self->add_plugins(
277 [ 'Git::Push' => {
278 push_to => join q{ },
279 $upstream, $dev_branch, $release_branch,
280 }
281 ],
282 'FakeRelease',
283 );
284 }
285  
286 0 return;
287 }
288  
289 1 1;
290  
291 __END__
↑ Summary MintingProfile/GEEKRUTH.pm »