Kit/Parts/Common.pm untested

filter: Statementstmt 0.0% 0 / 33 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 23 Podpod 0.0% 0 / 17 totaltotal 0.0% 0 / 73 CC 1 SCAR 6.9
CC
1
Cov
0%
feature_strict_default
2.0
feature_strict_export
2.0
feature_strict_order
2.0
CRAP 2.0
1 package Code::Style::Kit::Parts::Common;
2 use strict;
3 use warnings;
4 our $VERSION = '1.0.3'; # VERSION
5 # ABSTRACT: commonly used features
6  
7  
8 use Import::Into;
9  
10 # use strict
11 sub feature_strict_default { 1 }
12 sub feature_strict_export { strict->import() }
13 sub feature_strict_order { 1 } # export this first
14  
15 # try {} catch {} finally {};
16 sub feature_try_tiny_default { 1 }
17 sub feature_try_tiny_export_list { 'Try::Tiny' }
18  
19 # croak, confess, etc.
20 sub feature_carp_default { 1 }
21 sub feature_carp_export_list { 'Carp' }
22  
23 # No need to finish modules with 1;
24 sub feature_true_default { 1 }
25 sub feature_true_export {
26 require true;
27 true->import({ into => $_[1] });
28 }
29  
30 # This must come after anything else that might change warning
31 # levels in the caller (e.g. Moose)
32 sub feature_fatal_warnings_default { 1 }
33 sub feature_fatal_warnings_export {
34 warnings->import( FATAL => 'all' );
35 # see L<< C<strictures> >>
36 my @NONFATAL = grep { exists $warnings::Offsets{$_} }
37 qw( exec
38 recursion
39 internal
40 malloc
41 newline
42 experimental
43 deprecated
44 portable );
45 warnings->unimport( FATAL => @NONFATAL );
46 warnings->import( NONFATAL => @NONFATAL );
47 warnings->unimport('once');
48 }
49 sub feature_fatal_warnings_order { 900 } # so we set its order value high
50  
51 # Auto-clean up imported symbols
52 sub feature_namespace_autoclean_default { 1 }
53 sub feature_namespace_autoclean_export {
54 require namespace::autoclean;
55 namespace::autoclean->import(-cleanee=>$_[1]);
56 }
57 sub feature_namespace_autoclean_order { 910 } # more-or-less last thing
58  
59 sub feature_log_any_default { 1 }
60 sub feature_log_any_export {
61 require Log::Any;
62 Log::Any->import::into($_[1],'$log');
63 }
64  
65  
66 1;
67  
68 __END__