NAME
Perl::Critic::Policy::logicLAB::RequireSheBang - simple policy for keeping your shebang line uniform
AFFILIATION
This policy is a policy in the Perl::Critic::logicLAB distribution.
VERSION
This documentation describes version 0.01.
DESCRIPTION
This policy is intended in guarding your use of the shebang line. It assists in making sure that your shebang line adheres to certain formats.
The default format is
#!/usr/local/bin/perl
You can however specify another or define your own in the configuration of the policy.
CONFIGURATION AND ENVIRONMENT
This policy allow you to configure the contents of the shebang lines you want to allow using "formats".
formats
[logicLAB::RequireSheBang]
formats = #!/usr/local/bin/perl || #!/usr/bin/perl || #!perl || #!env perl
Since the default shebang line enforced by the policy is:
#!/usr/local/bin/perl
Please note that if you however what to extend the pattern, you also have to specify was is normally the default pattern since configuration overwrites the default even for extensions.
This mean that if you want to allow:
#!/usr/local/bin/perl
#!/usr/local/bin/perl -w
#!/usr/local/bin/perl -wT
Your format should look like the following:
[logicLAB::RequireSheBang]
formats = #!/usr/local/bin/perl || #!/usr/local/bin/perl -w || #!/usr/local/bin/perl -wT
DEPENDENCIES AND REQUIREMENTS
INCOMPATIBILITIES
This distribution has no known incompatibilities.
BUGS AND LIMITATIONS
The distribution has now known bugs or limitations. It locates shebang lines through out the source code, not limiting itself to the first line. This might however change in the future, but will propably be made configurable is possible.
BUG REPORTING
Please use Requets Tracker for bug reporting:
http://rt.cpan.org/NoAuth/Bugs.html?Dist=Perl-Critic-logicLAB-RequireSheBang
TEST AND QUALITY
The following policies have been disabled for this distribution
See also t/perlcriticrc
TEST COVERAGE
Coverage test executed the following way:
TEST_AUTHOR=1 TEST_CRITIC=1 TEST_VERBOSE=1 ./Build testcover
---------------------------- ------ ------ ------ ------ ------ ------ ------
File stmt bran cond sub pod time total
---------------------------- ------ ------ ------ ------ ------ ------ ------
Build.PL 100.0 n/a n/a 100.0 n/a 0.0 100.0
...ogicLAB/RequireSheBang.pm 100.0 100.0 100.0 100.0 100.0 0.0 100.0
t/critic.t 100.0 75.0 33.3 100.0 n/a 25.0 92.1
t/implementation.t 100.0 n/a n/a 100.0 n/a 25.0 100.0
t/prerequisites.t 94.7 83.3 n/a 100.0 n/a 25.0 93.1
t/test.t 94.9 25.0 n/a 100.0 n/a 25.0 91.0
Total 97.5 72.2 66.7 100.0 100.0 100.0 95.0
---------------------------- ------ ------ ------ ------ ------ ------ ------
SEE ALSO
AUTHOR
Jonas B. Nielsen, jonasbn
<jonasbn@cpan.org>
LICENSE AND COPYRIGHT
Copyright (c) 2011 Jonas B. Nielsen. All rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.