blib/lib/Dist/Zilla/PluginBundle/Author/GTERMARS.pm

filter: Statementstmt 68.7% 11 / 16 Branchbran 0.0% 0 / 8 Conditioncond 0.0% 0 / 8 MC/DCmcdc 0.0% 0 / 4 Subroutinesub 50.0% 2 / 4 Podpod 0.0% 0 / 1 totaltotal 31.7% 13 / 41 CC 8 SCAR 32.7
CC
8
Cov
34%
configure
42.0
_build_fake_release
12.0
BEGIN
1.0
CRAP 26.4
↑ Summary
1 package Dist::Zilla::PluginBundle::Author::GTERMARS;
2  
3 1 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 with qw(
5 Dist::Zilla::Role::PluginBundle::Easy
6 Dist::Zilla::Role::PluginBundle::PluginRemover
7 Dist::Zilla::Role::PluginBundle::Config::Slicer
8 );
9 1 ▶use namespace::autoclean;
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11 1 our $VERSION = '0.06';
12  
13 1 has fake_release => (
14 is => 'ro',
15 isa => 'Bool',
16 lazy_build => 1,
17 );
18 0 ▶sub _build_fake_release {
Subroutine _build_fake_release: not called CC=3 SCAR=24.8
19 0 my $self = shift;
20 0 ▶ return $ENV{FAKE_RELEASE} // $self->payload->{fake_release} // 0;
Condition0%0/5
($ENV{"FAKE_RELEASE"} // $self->payload->{"fake_release"}) // 0
l!l
00
$ENV{"FAKE_RELEASE"} // $self->payload->{"fake_release"}
l!l&&r!l&&!r
000
MC/DC0%0/2
($ENV{"FAKE_RELEASE"} // $self->payload->{"fake_release"}) // 0
$ENV{"FAKE_RELEASE"} $self->payload->{"fake_release"}
Truth table0%0/3
A // B
A= $ENV{"FAKE_RELEASE"}B= $self->payload->{"fake_release"}
ABresult
1X1
011
000
21 }
22  
23 0 ▶sub configure {
Subroutine configure: not called CC=6 SCAR=37.4
Pod undocumented
24 0 my $self = shift;
25  
26 $self->add_plugins(
27 ###########################################################################
28 # Ensure we're using the correct Author Bundle
29 [ 'PromptIfStale' => 'Stale author bundle' => {
30 phase => 'build',
31 module => 'Dist::Zilla::PluginBundle::Author::GTERMARS',
32 },
33 ],
34  
35 ###########################################################################
36 # Gather up all the files we need in our distribution
37 [ 'GatherDir' => {
38 exclude_filename => [qw( dist.ini cpanfile )],
39 },
40 ],
41 [ 'ExecDir' => {
42 dir => (-d 'script' ? 'script' : 'bin'),
43 },
44 ],
45 [ 'ShareDir' ],
46 [ 'PruneCruft' ],
47  
48 ###########################################################################
49 # Auto-generate files as needed...
50 # ... Makefile.PL
51 [ 'MakeMaker' ],
52 # ... MANIFEST
53 [ 'Manifest' ],
54 # ... LICENSE
55 [ 'License' ],
56 # ... README (both .md and .txt)
57 [ 'ReadmeAnyFromPod' => 'ReadmeGfmInRoot' ],
58 [ 'ReadmeAnyFromPod' => 'ReadmeInDist' ],
59 # ... Dependencies
60 [ 'Prereqs::FromCPANfile' ],
61 [ 'Prereqs::AuthorDeps' ],
62 # ... META
63 [ 'MetaYAML' ],
64 [ 'MetaJSON' ],
65 [ 'MetaNoIndex' => {
66 0 ▶ directory => [ qw( t xt ), grep { -d $_ } qw( examples inc local share ) ],
Branch: 3 branches
BranchTrueFalseTotal
$ENV{'AUTOMATED_TESTING'} || $ENV{'CI'} ? : 0 0 0
$self->fake_release ? : 0 0 0
$self->fake_release ? : 0 0 0
Condition0%0/3
$ENV{"AUTOMATED_TESTING"} or $ENV{"CI"}
l!l&&r!l&&!r
000
MC/DC0%0/2
$ENV{"AUTOMATED_TESTING"} or $ENV{"CI"}
$ENV{"AUTOMATED_TESTING"} $ENV{"CI"}
Truth table0%0/3
A or B
A= $ENV{"AUTOMATED_TESTING"}B= $ENV{"CI"}
ABresult
1X1
011
000
67 },
68 ],
69 # ... Tests
70 [ 'MetaTests' ],
71 [ 'Test::ReportPrereqs' => {
72 verify_prereqs => 1,
73 },
74 ],
75 [ 'Test::NoTabs' ],
76 [ 'Test::EOL' ],
77 [ 'Test::EOF' ],
78 [ 'Test::MinimumVersion' ],
79 [ 'Test::Synopsis' ],
80 [ 'PodSyntaxTests' ],
81 [ 'PodCoverageTests' ],
82 [ 'Test::PodSpelling' ],
83 [ 'Test::NoBreakpoints' ],
84 [ 'Test::CleanNamespaces' ],
85 [ 'Test::DiagINC' ],
86 [ 'Test::UnusedVars' ],
87 [ 'Test::Kwalitee' ],
88 [ 'Test::Compile' => {
89 fake_home => 1,
90 filename => 't/01-compile.t',
91 bail_out_on_fail => 1,
92 },
93 ],
94  
95 ###########################################################################
96 # Additional Metadata
97 ( ($ENV{AUTOMATED_TESTING} || $ENV{CI})
98 0 ▶ ? ()
Branch: 1 branch
BranchTrueFalseTotal
-d 'script' ? : 0 0 0
99 : ([ 'GitHub::Meta' ])
100 ),
101 [ 'StaticInstall', {
102 mode => 'auto',
103 },
104 ],
105  
106 ###########################################################################
107 # Run "xt/" tests, but don't include them in the release.
108 [ 'RunExtraTests', {
109 default_jobs => 8,
110 },
111 ],
112  
113 ###########################################################################
114 # Munge existing files
115 [ 'NextRelease' ],
116 [ 'RewriteVersion' ],
117  
118 ###########################################################################
119 # Release
120 # ... before release
121 [ 'PromptIfStale' => 'Stale modules, release' => {
122 phase => 'release',
123 check_all_plugins => 1,
124 check_all_prereqs => 1,
125 skip => [qw( ExtUtils::MakeMaker )],
126 },
127 ],
128 [ 'Git::CheckFor::MergeConflicts' ],
129 [ 'Git::CheckFor::CorrectBranch' => {
130 release_branch => 'main',
131 },
132 ],
133 [ 'EnsureChangesHasContent' ],
134 [ 'EnsureMinimumPerl' ],
135 [ 'Git::Check' => 'initial check' ],
136 [ 'TestRelease' ],
137 [ 'Git::Check' => 'after tests' ],
138 [ 'GitHub::RequireGreenBuild' ],
139 [ 'CheckIssues' ],
140 # ... do the release
141 ( $self->fake_release
142 ? ( [ 'FakeRelease' ] )
143 : ( [ 'ConfirmRelease' ], [ 'UploadToCPAN' ], [ 'GitHub::Update' ] )
144 ),
145 # ... after release; commit Changes and Tag release
146 [ 'Git::Commit' => 'Commit Changes' => {
147 commit_msg => 'Release v%V',
148 },
149 ],
150 [ 'Git::Tag' ],
151 # ... after release; save Release artifacts
152 [ 'Git::CommitBuild' => {
153 branch => '',
154 release_branch => 'releases',
155 release_message => 'Release - v%v',
156 },
157 ],
158 # ... after release; bump Version for next release
159 [ 'BumpVersionAfterRelease' ],
160 [ 'Git::Commit' => 'Commit Version Bump' => {
161 allow_dirty_match => '^lib/',
162 commit_msg => 'Version bump.',
163 },
164 ],
165 # ... after release; push changes up to Git
166 ( $self->fake_release
167 ? ()
168 : ( [ 'Git::Push', { push_to => [ 'origin', 'origin releases:releases' ] } ] )
169 ),
170 );
171 }
172  
173 1 __PACKAGE__->meta->make_immutable;
174 1 1;
175  
176 =head1 NAME
177  
178 Dist::Zilla::PluginBundle::Author::GTERMARS - Plugin Bundle for distributions built by GTERMARS
179  
180 =head1 SYNOPSIS
181  
182 In your F<dist.ini>:
183  
184 [@Author::GTERMARS]
185  
186 =head1 DESCRIPTION
187  
188 This is the C<Dist::Zilla> plugin bundle that GTERMARS uses to build his
189 distributions.
190  
191 It is I<roughly> equivalent to the following:
192  
193 ; ==============================================================================
194 ; Ensure we're using the correct Author Bundle
195 [PromptIfStale / Stale author bundle]
196 phase = build
197 module = Dist::Zilla::PluginBundle::Author::GTERMARS
198  
199 ; ==============================================================================
200 ; Gather up all the files we need in our distribution
201 [GatherDir]
202 exclude_filename = dist.ini
203 exclude_filename = cpanfile
204 [ExecDir]
205 dir = (-d 'script' ? 'script' : 'bin')
206 [ShareDir]
207 [PruneCruft]
208  
209 ; ==============================================================================
210 ; Auto-generate files as needed...
211 ; ... Makefile.PL
212 [MakeMaker]
213 ; ... MANIFEST
214 [Manifest]
215 ; ... LICENSE
216 [License]
217 ; ... README file(s)
218 [ReadmeAnyFromPod / ReadmeGfmInRoot]
219 [ReadmeAnyFromPod / ReadmeInDist]
220 ; ... Dependencies
221 [Prereqs::FromCPANfile]
222 [Prereqs::AuthorDeps]
223 ; ... META
224 [MetaYAML]
225 [MetaJSON]
226 [MetaNoIndex]
227 directory = examples
228 directory = inc
229 directory = local
230 directory = share
231 directory = t
232 directory = xt
233 ; ... Tests
234 [MetaTests]
235 [Test::ReportPrereqs]
236 verify_prereqs = 1
237 [Test::NoTabs]
238 [Test::EOL]
239 [Test::EOF]
240 [Test::MinimumVersion]
241 [Test::Synopsis]
242 [PodSyntaxTests]
243 [PodCoverageTests]
244 [Test::PodSpelling]
245 [Test::NoBreakpoints]
246 [Test::CleanNamespaces]
247 [Test::DiagINC]
248 [Test::UnusedVars]
249 [Test::Kwalitee]
250 [Test::Compile]
251 fake_home = 1
252 filename = t/01-compile.t
253 bail_out_on_fail = 1
254  
255 ; ==============================================================================
256 ; Additional Metadata
257 [GitHub::Meta]
258 [StaticInstall]
259 mode = auto
260  
261 ; ==============================================================================
262 ; Run "xt/" tests, but don't include them in the release.
263 [RunExtraTests]
264 default_jobs = 8
265  
266 ; ==============================================================================
267 ; Munge existing files
268 [NextRelease]
269 [RewriteVersion]
270  
271 ; ==============================================================================
272 ; Release
273  
274 ; ... before release
275 [PromptIfStale / Stale modules, release]
276 phase = release
277 check_all_plugins = 1
278 check_all_prereqs = 1
279 skip = ExtUtils::MakeMaker
280 [Git::CheckFor::MergeConflicts]
281 [Git::CheckFor::CorrectBranch]
282 release_branch = main
283 [EnsureChangesHasContent]
284 [EnsureMinimumPerl]
285 [Git::Check / initial check]
286 [TestRelease]
287 [Git::Check / after tests]
288 [GitHub::RequireGreenBuild]
289 [CheckIssues]
290  
291 ; ... do the release (unless "fake_release" is set)
292 [ConfirmRelease]
293 [UploadToCPAN]
294 [GitHub::Update]
295  
296 ; ... after release; commit Changes and Tag release
297 [Git::Commit / Commit Changes]
298 commit_msg = Release v%V
299 [Git::Tag]
300  
301 ; ... after release; save Release artifacts
302 [Git::CommitBuild]
303 branch =
304 release_branch = releases
305 release_message = Release - v%v
306  
307 ; ... after release; bump Version for next release
308 [BumpVersionAfterRelease]
309 [Git::Commit / Commit Version Bump]
310 allow_dirty_match = ^lib/
311 commit_msg = Version bump.
312  
313 ; ... after release; push changes up to Git (unless "fake_release" is set)
314 [Git::Push]
315 push_to = origin
316 push_to = origin releases:releases
317  
318 =head1 CUSTOMIZATION
319  
320 =head2 Our Configuration Options
321  
322 =over
323  
324 =item fake_release
325  
326 A boolean option, which when set, removes C<[ConfirmRelease]>,
327 C<[UploadToCPAN]>, and C<[GitHub::Update]>, replacing them with
328 C<[FakeRelease]>.
329  
330 Defaults to false, and can also be set with the C<FAKE_RELEASE=1> environment
331 variable.
332  
333 =back
334  
335 =head2 POD Coverage
336  
337 Subroutines can be considered "covered" for POD Coverage checks, by adding a
338 directive to the POD itself, as described in L<Pod::CoverageTrustPod>:
339  
340 =for Pod::Coverage foo bar baz
341  
342 =head2 POD Spelling
343  
344 Stopwords for POD Spelling checks can be added by adding a directive to the POD
345 itself, as described in L<Pod::Spell>:
346  
347 =for stopwords foo bar baz
348  
349 =head2 Providing Plugin Configuration
350  
351 This plugin bundle uses C<Dist::Zilla::Role::PluginBundle::Config::Slicer>,
352 which allows you to provide plugin-specific configuration like this:
353  
354 [@Author::GTERMARS]
355 GatherDir.exclude_filename = cpanfile
356  
357 =head2 Removing Plugins
358  
359 This plugin bundle uses C<Dist::Zilla::Role::PluginBundle::Remover>, allowing
360 you to remove specific plugins like this:
361  
362 [@Author::GTERMARS]
363 -remove = GitHub::Meta
364 -remove = RunExtraTests
365  
366 =head1 AUTHOR
367  
368 Graham TerMarsch (cpan@howlingfrog.com)
369  
370 =head1 COPYRIGHT
371  
372 Copyright (C) 2020-, Graham TerMarsch. All Rights Reserved.
373  
374 This is free software; you can redistribute it and/or modify it under the same
375 license as Perl itself.
376  
377 =head1 SEE ALSO
378  
379 =over
380  
381 =item L<Dist::Zilla>
382  
383 =back
384  
385 =cut
↑ Summary