Claes Jakobsson > Module-Checkstyle-0.04 > Module::Checkstyle::Check::Variable

Download:
Module-Checkstyle-0.04.tar.gz

Dependencies

Annotate this POD

CPAN RT

New  1
Open  1
View/Report Bugs
Source  

NAME ^

Module::Checkstyle::Check::Variable - Checks variable declarations

LIMITATIONS ^

The checks provided by this module currently only works for variables declared using my, our or local. It may in the future also support use vars qw(...); style declarations.

The checks arrays-in-plural and hashes-in-singular works best with the english language and may not always be correct. Internally it uses Lingua::EN::Inflect::Number that relies on Lingua::EN::Inflect do determine plural/singular forms.

CONFIGURATION DIRECTIVES ^

Variable name

Checks that a variable is named correctly. Use matches-name to specify a regular expression that must match.

matches-name = qr/\w+/

Name arrays in plural

Checks that an array has a plural name as in @values but not @value. Set arrays-in-plural to a true value to enable.

arrays-in-plural = true

Name hashes in singular

Checks that a hash has a singular name as in %key but not %keys. Set hashes-in-singular to a true value to enable.

hashes-in-singular = true

SEE ALSO ^

Writing configuration files. "Format" in Module::Checkstyle::Config

Module::Checkstyle

Lingua::EN::Inflect::Number

Lingua::EN::Inflect

syntax highlighting: