File Coverage

blib/lib/Perl/Tidy/Komodo.pm
Criterion Covered Total %
statement 9 20 45.0
branch 0 4 0.0
condition 0 3 0.0
subroutine 3 5 60.0
pod 1 1 100.0
total 13 33 39.3


line stmt bran cond sub pod time code
1 1     1   100705 use strictures;
  1         2  
  1         9  
2              
3             package Perl::Tidy::Komodo;
4              
5             our $VERSION = '1.151340'; # VERSION
6              
7             # ABSTRACT: tidy perl files in Komodo with a project rc
8              
9             #
10             # This file is part of Perl-Tidy-Komodo
11             #
12             #
13             # Christian Walde has dedicated the work to the Commons by waiving all of his
14             # or her rights to the work worldwide under copyright law and all related or
15             # neighboring legal rights he or she had in the work, to the extent allowable by
16             # law.
17             #
18             # Works under CC0 do not require attribution. When citing the work, you should
19             # not imply endorsement by the author.
20             #
21              
22 1     1   4388 use Perl::Tidy;
  1         4707587  
  1         193  
23 1     1   11 use File::chdir;
  1         3  
  1         319  
24              
25              
26             sub run {
27 0     0 1   _try_set_perltidy_env();
28 0           Perl::Tidy::perltidy();
29             }
30              
31             sub _try_set_perltidy_env {
32 0 0   0     return if exists $ENV{PERLTIDY};
33 0           my @cwd_store = @CWD;
34 0           while ( $CWD[0] ) {
35 0 0 0       if ( -d 'lib' and -f '.perltidyrc' ) {
36 0           $ENV{PERLTIDY} = $CWD;
37 0           last;
38             }
39 0           pop @CWD;
40             }
41 0           @CWD = @cwd_store;
42 0           return;
43             }
44              
45             1;
46              
47             __END__
48              
49             =pod
50              
51             =head1 NAME
52              
53             Perl::Tidy::Komodo - tidy perl files in Komodo with a project rc
54              
55             =head1 VERSION
56              
57             version 1.151340
58              
59             =head1 DESCRIPTION
60              
61             This file provides the functionality behind a command line script. For
62             usage documentation, please see: L<perltidy_ko>.
63              
64             =head1 METHODS
65              
66             =head2 run
67              
68             Tries to find a directory that looks like a project directory, upwards
69             from CWD and stores its path in $ENV{PERLTIDY}. Then Perl::Tidy itself is
70             run.
71              
72             =for :stopwords cpan testmatrix url annocpan anno bugtracker rt cpants kwalitee diff irc mailto metadata placeholders metacpan
73              
74             =head1 SUPPORT
75              
76             =head2 Bugs / Feature Requests
77              
78             Please report any bugs or feature requests through the issue tracker
79             at L<http://rt.cpan.org/Public/Dist/Display.html?Name=Perl-Tidy-Komodo>.
80             You will be notified automatically of any progress on your issue.
81              
82             =head2 Source Code
83              
84             This is open source software. The code repository is available for
85             public review and contribution under the terms of the license.
86              
87             L<https://github.com/wchristian/perl-tidy-komodo>
88              
89             git clone https://github.com/wchristian/perl-tidy-komodo.git
90              
91             =head1 AUTHOR
92              
93             Christian Walde <walde.christian@googlemail.com>
94              
95             =head1 COPYRIGHT AND LICENSE
96              
97              
98             Christian Walde has dedicated the work to the Commons by waiving all of his
99             or her rights to the work worldwide under copyright law and all related or
100             neighboring legal rights he or she had in the work, to the extent allowable by
101             law.
102              
103             Works under CC0 do not require attribution. When citing the work, you should
104             not imply endorsement by the author.
105              
106             =cut