File Coverage

blib/lib/App/GitHooks/Constants.pm
Criterion Covered Total %
statement 12 12 100.0
branch n/a
condition n/a
subroutine 4 4 100.0
pod n/a
total 16 16 100.0


line stmt bran cond sub pod time code
1             package App::GitHooks::Constants;
2              
3 47     47   18456 use strict;
  47         72  
  47         1329  
4 47     47   196 use warnings;
  47         57  
  47         1336  
5              
6             # External dependencies.
7 47     47   200 use base 'Exporter';
  47         53  
  47         4306  
8 47     47   23918 use Readonly;
  47         177434  
  47         9681  
9              
10              
11             =head1 NAME
12              
13             App::GitHooks::Constants - Constants used by various modules in the App::GitHooks namespace.
14              
15              
16             =head1 VERSION
17              
18             Version 1.9.0
19              
20             =cut
21              
22             our $VERSION = '1.9.0';
23              
24              
25             =head1 VARIABLES
26              
27             =head2 Plugin return values
28              
29             =over 4
30              
31             =item * C<$PLUGIN_RETURN_FAILED>
32              
33             Indicates that the checks performed by the plugin did not pass.
34              
35             =item * C<$PLUGIN_RETURN_SKIPPED>
36              
37             Indicates that the checks performed by the plugin were skipped.
38              
39             =item * C<$PLUGIN_RETURN_WARNED>
40              
41             Indicates that the checks performed by the plugins didn't fail, but they didn't
42             pass cleanly either and warnings were returned.
43              
44             =item * C<$PLUGIN_RETURN_PASSED>
45              
46             Indicates that the checks performed by the plugin passed and no warn.
47              
48             =back
49              
50             =cut
51              
52             Readonly::Scalar our $PLUGIN_RETURN_FAILED => -1;
53             Readonly::Scalar our $PLUGIN_RETURN_SKIPPED => 0;
54             Readonly::Scalar our $PLUGIN_RETURN_PASSED => 1;
55             Readonly::Scalar our $PLUGIN_RETURN_WARNED => 2;
56              
57              
58             =head2 Hook exit codes
59              
60             =over 4
61              
62             =item * C<$HOOK_EXIT_SUCCESS>
63              
64             Indicates that the hook executed successfully.
65              
66             =item * C<$HOOK_EXIT_FAILURE>
67              
68             Indicates that the hook failed to execute correctly.
69              
70             =back
71              
72             =cut
73              
74             Readonly::Scalar our $HOOK_EXIT_SUCCESS => 0;
75             Readonly::Scalar our $HOOK_EXIT_FAILURE => 1;
76              
77              
78             =head1 EXPORT TAGS
79              
80             =over 4
81              
82             =item * C<:PLUGIN_RETURN_CODES>
83              
84             Exports C<$PLUGIN_RETURN_FAILED>, C<$PLUGIN_RETURN_SKIPPED>, and C<$PLUGIN_RETURN_PASSED>.
85              
86             =item * C<:HOOK_EXIT_CODES>
87              
88             Exports C<$HOOK_EXIT_SUCCESS>, C<$HOOK_EXIT_FAILURE>.
89              
90             =back
91              
92             =cut
93              
94             # Exportable variables.
95             our @EXPORT_OK = qw(
96             $PLUGIN_RETURN_FAILED
97             $PLUGIN_RETURN_SKIPPED
98             $PLUGIN_RETURN_PASSED
99             $PLUGIN_RETURN_WARNED
100             $HOOK_EXIT_SUCCESS
101             $HOOK_EXIT_FAILURE
102             );
103              
104             # Exported tags.
105             our %EXPORT_TAGS =
106             (
107             PLUGIN_RETURN_CODES =>
108             [
109             qw(
110             $PLUGIN_RETURN_FAILED
111             $PLUGIN_RETURN_SKIPPED
112             $PLUGIN_RETURN_PASSED
113             $PLUGIN_RETURN_WARNED
114             )
115             ],
116             HOOK_EXIT_CODES =>
117             [
118             qw(
119             $HOOK_EXIT_SUCCESS
120             $HOOK_EXIT_FAILURE
121             )
122             ],
123             );
124              
125              
126             =head1 BUGS
127              
128             Please report any bugs or feature requests through the web interface at
129             L<https://github.com/guillaumeaubert/App-GitHooks/issues/new>.
130             I will be notified, and then you'll automatically be notified of progress on
131             your bug as I make changes.
132              
133              
134             =head1 SUPPORT
135              
136             You can find documentation for this module with the perldoc command.
137              
138             perldoc App::GitHooks::Constants
139              
140              
141             You can also look for information at:
142              
143             =over
144              
145             =item * GitHub's request tracker
146              
147             L<https://github.com/guillaumeaubert/App-GitHooks/issues>
148              
149             =item * AnnoCPAN: Annotated CPAN documentation
150              
151             L<http://annocpan.org/dist/app-githooks>
152              
153             =item * CPAN Ratings
154              
155             L<http://cpanratings.perl.org/d/app-githooks>
156              
157             =item * MetaCPAN
158              
159             L<https://metacpan.org/release/App-GitHooks>
160              
161             =back
162              
163              
164             =head1 AUTHOR
165              
166             L<Guillaume Aubert|https://metacpan.org/author/AUBERTG>,
167             C<< <aubertg at cpan.org> >>.
168              
169              
170             =head1 COPYRIGHT & LICENSE
171              
172             Copyright 2013-2017 Guillaume Aubert.
173              
174             This code is free software; you can redistribute it and/or modify it under the
175             same terms as Perl 5 itself.
176              
177             This program is distributed in the hope that it will be useful, but WITHOUT ANY
178             WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
179             PARTICULAR PURPOSE. See the LICENSE file for more details.
180              
181             =cut
182              
183             1;