Perl::Critic::Policy::logicLAB::ModuleBlacklist - blacklist modules you want to prohibit use of
This policy has no affiliation The policy is themed: logiclab
and maintenance
.
This documentation describes version 1.00
This policy can be used to specify a list of unwanted modules. Using a blacklisting, so if the modules are used in the evaluated code a violation is triggered.
In addition to blacklisting modules it is possible to recommend alternatives to blacklisted modules.
And alternative could be Perl::Critic core has Perl::Critic::Policy::Modules::ProhibitEvilModules. which offers a solution in the same problem area.
You can blacklist modules using the configuration parameter modules
[logicLAB::ModuleBlacklist]
modules = IDNA::Punycode
If you want to blacklist multiple modules specify using a comma separated list:
[logicLAB::ModuleBlacklist]
modules = Try::Tiny, Contextual::Return, IDNA::Punycode
If you want to recommend alternatives to, use fat comma in addition
[logicLAB::ModuleBlacklist]
modules = Try::Tiny => TryCatch, Contextual::Return, IDNA::Punycode => Net::IDN::Encode
- Perl 5.8.0 syntactically for the actual implementation
- Perl 5.14 for developing the distribution, which relies on Dist::Zilla. The features on which this policy relies, where introduced in Perl 5.14, but this does not make for an actual requirement for the policy only the recommendations it imposes.
- Module::Build
- Perl::Critic
- Perl::Critic::Utils
- Perl::Critic::Policy
- Test::More
- Test::Perl::Critic
- Data::Dumper
- Carp
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.
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
---------------------------- ------ ------ ------ ------ ------ ------ ------
...Module/ModuleBlacklist.pm 92.4 70.0 62.5 100.0 100.0 100.0 87.3
Total 92.4 70.0 62.5 100.0 100.0 100.0 87.3
---------------------------- ------ ------ ------ ------ ------ ------ ------
Please report issues via CPAN RT:
http://rt.cpan.org/NoAuth/Bugs.html?Dist=Perl-Critic-Policy-logicLAB-ModuleBlacklist
or by sending mail to
bug-Perl-Critic-Policy-logicLAB-ModuleBlacklist@rt.cpan.org
I once read an article which compared programming languages to natural languages. Programming languages in themselves are not large as such, but if you also regard the APIs, data structures and components a computer programmer use on a daily basis, the amount is enormous.
Where I work We try to keep a more simple code base, the complexity is in our business and that is our primary problem area, so it should not be difficult to understand the code used to model this complexity.
So sometimes it is necessary to make a decision on what should be allowed in our code base and what should not. This policy aims to support this coding practice.
The practice it basically to prohibit problematic components and recommend alternatives where possible.
Here follows some recommendations I have picked up.
- Error should be replaced by Class::Exception, by recommendation of the author
- IDNA::Punycode should be replaced by Net::IDN::Encode by recommendation of the author, who wrote both
- File::Slurp should be replaced by either File::Slurper, Path::Tiny or IO::All See also blog post: "File::Slurp is broken and wrong" by Leon Timmermans
- File::Stat should be replaced by File::stat
- Jonas B. (jonasbn)
<jonasbn@cpan.org>
- Perl::Critic authors and maintainers for Perl::Critic
- Milan Šorm for the first and second bug reports on this policy
Copyright (c) 2014-2019 Jonas B. (jonasbn). All rights reserved.
Perl::Critic::Policy::logicLAB::ModuleBlacklist 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.