Perl::Critic::Policy::Variables::RequireHungarianNotation - Critic policy for hungarian notation.
Version 0.0.6
Don't let anyone guess which type you expect in your code:
my @array = (); # don't do this my %hash = (); # or this my $hashref = {}; # or this my $arrayref = []; # or this my $string = ''; # or this
The policy is also running through sub declarations.
# won't work sub some_sub { my ($self, $arrayref, $string) = @_; ... }
Instead, do this:
my @a_array = (); # do this my %h_hash = (); # and this my $hr_hashref = {}; # and this my $ar_arrayref = []; # and this my $s_string = ''; # and this # this will (hopefuly) sub some_sub { my ($self, $ar_arrayref, $s_string) = @_; ... }
$self as variable is excluded.
Returns a string containing an explanation of this policy.
Return an array with information about the parameters supported.
my @supported_parameters = $policy->supported_parameters();
Returns a numeric constant defining the severity of violating this policy.
Returns a list of strings defining the themes for this policy.
Returns a string describing the elements to which this policy applies.
Check an element for violations against this policy.
my $o_policy->violates( $o_element, $o_document );
Returns a string containing a sort description of this policy.
Perl::Critic::Policy
Each prefix is full configurable for it's own
Prefix for Array vars.
[Variables::RequireHungarianNotation] array = a_
Prefix for Hash vars.
[Variables::RequireHungarianNotation] hash = h_
Prefix for Arrayref vars.
[Variables::RequireHungarianNotation] array_ref = ar_
Prefix for Hashref vars.
[Variables::RequireHungarianNotation] hash_ref = hr_
Prefix for Coderef vars.
[Variables::RequireHungarianNotation] code_ref = cr_
Prefix for Object vars.
[Variables::RequireHungarianNotation] object = o_
Prefix for Integer vars.
[Variables::RequireHungarianNotation] integer = i_
Prefix for Float vars.
[Variables::RequireHungarianNotation] float = f_
Prefix for String vars.
[Variables::RequireHungarianNotation] string = s_
Prefix for Boolean vars.
[Variables::RequireHungarianNotation] boolean = b_
Prefix for predefined regular expressions.
[Variables::RequireHungarianNotation] regex = rx_
Ingore self is the class variable for it's own.
[Variables::RequireHungarianNotation] self = this
A space-separated list of possible types you can append by your own style.
[Variables::RequireHungarianNotation] custom = inv obj any
Perl::Critic::Policy, Perl::Critic::Utils
None reported.
Please report any bugs or feature requests to https://gitlab.com/mziescha/Perl-Critic-Policy-Variables-RequireHungarianNotation/issues.
Mario Zieschang <mziescha -at - cpan -dot- org>
<mziescha -at - cpan -dot- org>
Copyright (c) 2018, Mario Zieschang. All rights reserved.
This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See perlartistic.
BECAUSE THIS SOFTWARE IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE SOFTWARE, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE SOFTWARE "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE SOFTWARE IS WITH YOU. SHOULD THE SOFTWARE PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR, OR CORRECTION.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE SOFTWARE AS PERMITTED BY THE ABOVE LICENCE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE SOFTWARE (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE SOFTWARE TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
To install Perl::Critic::Policy::Variables::RequireHungarianNotation, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Perl::Critic::Policy::Variables::RequireHungarianNotation
CPAN shell
perl -MCPAN -e shell install Perl::Critic::Policy::Variables::RequireHungarianNotation
For more information on module installation, please visit the detailed CPAN module installation guide.