Perl::Critic::Policy::logicLAB::RequirePackageNamePattern - simple policy for enforcing a package naming policy
This policy is a policy in the Perl::Critic::logicLAB distribution. The policy is themed: logiclab.
This documentation describes version 0.05.
The policy can be used to enforced naming conventions for packages.
Policy configuration:
[logicLAB::RequirePackageNamePattern] names = Acme
Your package:
package This::Is::A::Test; # code goes here 1;
Invocation of policy:
$ perlcritic --single-policy logicLAB::RequirePackageNamePattern lib
Explanation:
Use specified requirement for package naming for This::Is::A::Test
Description:
Package name: This::Is::A::Test is not complying with required standard
This policy allow you to configure the contents of the shebang lines you want to allow using "names".
names, is the configuration parameter used to specify the patterns you want to enforce.
names
The different usage scenarios are documented below
[logicLAB::RequirePackageNamePattern] names = ^App::
[logicLAB::RequirePackageNamePattern] names = ::JONASBN$
[logicLAB::RequirePackageNamePattern] names = Utils$
[logicLAB::RequirePackageNamePattern] names = ^Acme
[logicLAB::RequirePackageNamePattern] names = Tiny
[logicLAB::RequirePackageNamePattern] names = Acme || logicLAB
Optionally and for development purposes I have added a debug flag. This can be set in your Perl::Critic configuration file as follows:
[logicLAB::RequirePackageNamePattern] debug = 1
This enables more explicit output on what is going on during the actual processing of the policy.
Module::Build
Perl::Critic
Perl::Critic::Utils
Perl::Critic::Policy
Test::More
Test::Class
Test::Perl::Critic
Data::Dumper
This distribution has no known incompatibilities.
There are no known bugs or limitations
The following policies have been disabled for this distribution
Perl::Critic::Policy::ValuesAndExpressions::ProhibitConstantPragma
Constants are good, - see the link below.
https://logiclab.jira.com/wiki/display/OPEN/Perl-Critic-Policy-ValuesAndExpressions-ProhibitConstantPragma
Perl::Critic::Policy::NamingConventions::Capitalization
See also t/perlcriticrc
Coverage test executed the following way, the coverage report is based on the version described in this documentation (see "VERSION").
./Build testcover ---------------------------- ------ ------ ------ ------ ------ ------ ------ File stmt bran cond sub pod time total ---------------------------- ------ ------ ------ ------ ------ ------ ------ ...uirePackageNamePattern.pm 89.2 68.2 36.4 100.0 100.0 100.0 82.5 Total 89.2 68.2 36.4 100.0 100.0 100.0 82.5 ---------------------------- ------ ------ ------ ------ ------ ------ ------
perlmod manpage
http://logiclab.jira.com/wiki/display/PCPLRPNP/Home
http://logiclab.jira.com/wiki/display/PCLL/Home
Jonas B. Nielsen, jonasbn <jonasbn@cpan.org>
<jonasbn@cpan.org>
Jeffrey Ryan Thalhammer (THALJEF) and the Perl::Critic contributors for Perl::Critic
Copyright (c) 2013-2015 Jonas B. Nielsen, jonasbn. All rights reserved.
Perl::Critic::Policy::logicLAB::RequirePackageNamePattern; is released under the Artistic License 2.0
The distribution is licensed under the Artistic License 2.0, as specified by the license file included in this distribution.
To install Perl::Critic::Policy::logicLAB::RequirePackageNamePattern, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Perl::Critic::Policy::logicLAB::RequirePackageNamePattern
CPAN shell
perl -MCPAN -e shell install Perl::Critic::Policy::logicLAB::RequirePackageNamePattern
For more information on module installation, please visit the detailed CPAN module installation guide.