NAME
Perl::Critic::Policy::Variables::RequireHungarianNotation - prohibit hungarian notation
VERSION
Version 0.0.1
SYNOPSIS
DESCRIPTION
Don't clutter your code with unnecessary variable initialization:
my @array = (); # don't do this
my %hash = (); # or this
my $hashref = {}; # or this
my $arrayref = []; # or this
my $string = ''; # or this
Instead, do this:
my @a_array = (); # do this
my %h_hash = (); # and this
my $hr_hashref = {}; # and this
my $hr_arrayref = []; # and this
my $s_string = ''; # and this
SUBROUTINES/METHODS
expl()
Returns a string containing an explanation of this policy.
supported_parameters
default_severity
Returns a numeric constant defining the severity of violating this policy.
default_themes
Returns a list of strings defining the themes for this policy.
applies_to
Returns a string describing the elements to which this policy applies.
violates
Method to determine if the element currently under scrutiny violates this policy. If it does, return a properly constructed Perl::Critic::Violation
object. Otherwise, return undef
.
violates_scalar($o_elem)
Returns true if $o_elem
contains an assignment of the form
my $foo = undef;
See http://search.cpan.org/dist/PPI/lib/PPI/Statement/Variable.pm for details on how this function works.
violates_list($o_elem)
Returns true if $o_elem
contains an assignment of the forms:
my @foo = (); # useless array init
my %bar = (); # useless hash init
desc()
INTERFACE
DIAGNOSTICS
Error message here, perhaps with %s placeholders
-
[Description of error here]
Another error message here
-
[Description of error here]
[Et cetera, et cetera]
CONFIGURATION AND ENVIRONMENT
Perl::Critic::Policy::Variables::RequireHungarianNotation requires no configuration files or environment variables.
DEPENDENCIES
Perl::Critic::Policy, Perl::Critic::Utils
INCOMPATIBILITIES
None reported.
BUGS AND LIMITATIONS
Please report any bugs or feature requests to https://gitlab.com/mziescha/Perl-Critic-Policy-Variables-RequireHungarianNotation/issues.
AUTHOR
Mario Zieschang <mziescha -at - cpan -dot- org>
LICENSE AND COPYRIGHT
Copyright (c) 2018, Mario Zieschang <mziescha@cpan.org>
. 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.
DISCLAIMER OF WARRANTY
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.