File Coverage

blib/lib/App/Critique.pm
Criterion Covered Total %
statement 23 24 95.8
branch 1 2 50.0
condition 8 12 66.6
subroutine 6 6 100.0
pod n/a
total 38 44 86.3


line stmt bran cond sub pod time code
1             package App::Critique;
2              
3 16     16   1205565 use strict;
  16         27  
  16         421  
4 16     16   57 use warnings;
  16         22  
  16         347  
5              
6 16     16   7154 use File::HomeDir ();
  16         67691  
  16         351  
7 16     16   9828 use JSON::XS ();
  16         70032  
  16         2977  
8              
9             our $VERSION = '0.04';
10             our $AUTHORITY = 'cpan:STEVAN';
11              
12             # load our CONFIG first, ...
13              
14             our %CONFIG;
15             BEGIN {
16 16   33 16   164 $CONFIG{'HOME'} = $ENV{'CRITIQUE_HOME'} || File::HomeDir->my_home;
17 16   100     581 $CONFIG{'COLOR'} = $ENV{'CRITIQUE_COLOR'} // 1;
18 16   100     98 $CONFIG{'DEBUG'} = $ENV{'CRITIQUE_DEBUG'} // 0;
19 16   100     66 $CONFIG{'VERBOSE'} = $ENV{'CRITIQUE_VERBOSE'} // 0;
20 16   33     87 $CONFIG{'EDITOR'} = $ENV{'CRITIQUE_EDITOR'} || $ENV{'EDITOR'} || $ENV{'VISUAL'};
21              
22             # okay, we give you sensible Perl & Git defaults
23 16         62 $CONFIG{'IGNORE'} = {
24             '.git' => 1,
25             'blib' => 1,
26             'local' => 1,
27             '_build' => 1,
28             };
29              
30             # then we add in any of yours
31 16 50       48 if ( my $ignore = $ENV{'CRITIQUE_IGNORE'} ) {
32             $CONFIG{'IGNORE'}->{ $_ } = 1
33 0         0 foreach split /\:/ => $ignore;
34             }
35              
36 16         941 $ENV{'ANSI_COLORS_DISABLED'} = ! $CONFIG{'COLOR'};
37             }
38              
39             # ... then gloablly used stuff, ....
40              
41             our $JSON = JSON::XS->new->utf8->pretty->canonical;
42              
43             # ... then load the app and plugins
44              
45 16         161 use App::Cmd::Setup -app => {
46             plugins => [
47             'Prompt',
48             '=App::Critique::Plugin::UI',
49             ]
50 16     16   7183 };
  16         496233  
51              
52             1;
53              
54             =pod
55              
56             =head1 NAME
57              
58             App::Critique - An incremental refactoring tool for Perl powered by Perl::Critic
59              
60             =head1 VERSION
61              
62             version 0.04
63              
64             =head1 DESCRIPTION
65              
66             This tool is specifically designed to find syntactic patterns in Perl source
67             code and allow you to review, refactor and commit your changes in one smooth
68             workflow.
69              
70             The idea behind L<App::Critique> is based on two assumptions.
71              
72             The first is that refactoring often involves a lot of repetitive and easily
73             automated actions, and this tool aims to make this workflow as smooth as
74             possible.
75              
76             The second is that many people, working on small incremental code improvements,
77             in individual easily revertable commits, can have a huge effect on a codebase,
78             which is exactly what this tool aims to do.
79              
80             The quickest way to start is to read the tutorial either by viewing the
81             documentation for L<App::Critique::Command::tutorial> or by installing the
82             app and running the following
83              
84             > critique tutorial
85              
86             =head1 AUTHOR
87              
88             Stevan Little <stevan@cpan.org>
89              
90             =head1 COPYRIGHT AND LICENSE
91              
92             This software is copyright (c) 2016 by Stevan Little.
93              
94             This is free software; you can redistribute it and/or modify it under
95             the same terms as the Perl 5 programming language system itself.
96              
97             =cut
98              
99             __END__
100              
101             # ABSTRACT: An incremental refactoring tool for Perl powered by Perl::Critic
102