PerlCritic

Perl::Critic is an extensible framework for creating and applying coding standards to Perl source code. Essentially, it is a static source code analysis engine. Perl::Critic is distributed with a number of CPAN:Perl::Critic::Policy modules that attempt to enforce various coding guidelines. Most Policy modules are based on http://en.wikipedia.org/wiki/Damian_Conway Damian Conway's book http://oreilly.com/catalog/9780596001735/ Perl Best Practices.

Violations are tracked at Tasks.Item15151.

Perl::Critic settings

We generally want to avoid criticisms with the default perlcritic settings, however, it's highly educational to run perlcritic --brutal and even perlcritic --cruel which still contains useful (and many not-so-useful) warnings which help avoid buggy code.

Constraint settings are stored in ~/.perlcriticrc

theme = bugs
verbose = 8

[-Subroutines::RequireFinalReturn]
[-ValuesAndExpressions::ProhibitConstantPragma]
[-ErrorHandling::RequireCheckingReturnValueOfEval]
[-Subroutines::ProhibitBuiltinHomonyms]
[-Variables::ProhibitReusedNames]

[BuiltinFunctions::ProhibitStringyEval]
allow_includes = 1

[Variables::RequireLocalizedPunctuationVars]
allow = @ARGV $ARGV %ENV

[Variables::ProhibitPunctuationVars]
allow = $@ $!

-- MichaelDaum - 29 Jun 2022

 

Topic revision: r7 - 29 Jun 2022, MichaelDaum
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License    Legal Imprint    Privacy Policy