Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/jonasbn/pcplrpv

Perl::Critic::Policy::logicLAB::RequireParamsValidate
https://github.com/jonasbn/pcplrpv

hacktoberfest perl perl-critic perl5 policy

Last synced: about 1 month ago
JSON representation

Perl::Critic::Policy::logicLAB::RequireParamsValidate

Awesome Lists containing this project

README

        

[![CPAN version](https://badge.fury.io/pl/Perl-Critic-Policy-logicLAB-RequireParamsValidate.svg)](http://badge.fury.io/pl/Perl-Critic-Policy-logicLAB-RequireParamsValidate)
[![Build Status](https://travis-ci.org/jonasbn/pcplrpv.svg?branch=master)](https://travis-ci.org/jonasbn/pcplrpv)
[![Coverage Status](https://coveralls.io/repos/jonasbn/pcplrpv/badge.png)](https://coveralls.io/r/jonasbn/pcplrpv)

# NAME

Perl::Critic::Policy::logicLAB::RequireParamsValidate - simple policy for enforcing use of Params::Validate

# AFFILIATION

This policy is a policy in the Perl::Critic::logicLAB distribution. The policy
is themed: logiclab.

# VERSION

This documentation describes version 0.03

# SYNOPSIS

# ok
sub foo {
validate(
@_, {
foo => 1, # mandatory
bar => 0, # optional
}
);

#...
}

# not ok
sub bar {
return 1;
}

# ok
sub _baz {
return 1;
}

Invocation of policy:

$ perlcritic --single-policy logicLAB::RequireParamsValidate lib

Explanation:

Use Params::Validate for public facing APIs

Description:

Parameter validation not complying with required standard

# CONFIGURATION AND ENVIRONMENT

No special requirements or environment required.

# DEPENDENCIES AND REQUIREMENTS

- [Module::Build](https://metacpan.org/pod/Module::Build)
- [Perl::Critic](https://metacpan.org/pod/Perl::Critic)
- [Perl::Critic::Utils](https://metacpan.org/pod/Perl::Critic::Utils)
- [Perl::Critic::Policy](https://metacpan.org/pod/Perl::Critic::Policy)
- [Test::More](https://metacpan.org/pod/Test::More)
- [Test::Class](https://metacpan.org/pod/Test::Class)
- [Test::Perl::Critic](https://metacpan.org/pod/Test::Perl::Critic)
- [Data::Dumper](https://metacpan.org/pod/Data::Dumper)
- [File::Spec](https://metacpan.org/pod/File::Spec)
- [List::MoreUtils](https://metacpan.org/pod/List::MoreUtils)
- [Params::Validate](https://metacpan.org/pod/Params::Validate)

# INCOMPATIBILITIES

This distribution has no known incompatibilities.

# BUGS AND LIMITATIONS

There are no known bugs or limitations

# TEST AND QUALITY

The following policies have been disabled for this distribution

- [Perl::Critic::Policy::ValuesAndExpressions::ProhibitConstantPragma](https://metacpan.org/pod/Perl::Critic::Policy::ValuesAndExpressions::ProhibitConstantPragma)

Constants are good, - see the link below.

- [https://logiclab.jira.com/wiki/display/OPEN/Perl-Critic-Policy-ValuesAndExpressions-ProhibitConstantPragma](https://logiclab.jira.com/wiki/display/OPEN/Perl-Critic-Policy-ValuesAndExpressions-ProhibitConstantPragma)

- [Perl::Critic::Policy::NamingConventions::Capitalization](https://metacpan.org/pod/Perl::Critic::Policy::NamingConventions::Capitalization)

See also `t/perlcriticrc`

## TEST COVERAGE

Coverage test executed the following way, the coverage report is based on the
version described in this documentation (see ["VERSION"](#version)).

./Build testcover

---------------------------- ------ ------ ------ ------ ------ ------ ------
File stmt bran cond sub pod time total
---------------------------- ------ ------ ------ ------ ------ ------ ------
.../RequireParamsValidate.pm 100.0 100.0 66.7 100.0 100.0 100.0 98.6
Total 100.0 100.0 66.7 100.0 100.0 100.0 98.6
---------------------------- ------ ------ ------ ------ ------ ------ ------

# SEE ALSO

- [Perl::Critic](https://metacpan.org/pod/Perl::Critic)
- [https://metacpan.org/pod/Params::Validate](https://metacpan.org/pod/Params::Validate)

# AUTHOR

- Jonas B. Nielsen, jonasbn ``

# ACKNOWLEDGEMENT

- Jeffrey Ryan Thalhammer (THALJEF) and the Perl::Critic contributors for
Perl::Critic

# LICENSE AND COPYRIGHT

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.