Subject: | Bad Document Example |
The following sample documentation is wrong,
--begin below here--
A simple configuration might look like this:
#--------------------------------------------------------------
# I think these are really important, so always load them
[TestingAndDebugging::RequireUseStrict]
severity = 5
[TestingAndDebugging::RequireUseWarnings]
severity = 5
#--------------------------------------------------------------
# I think these are less important, so only load when asked
[Variables::ProhibitPackageVars]
severity = 2
[ControlStructures::ProhibitPostfixControls]
allow = if unless #My custom configuration
severity = 2
#--------------------------------------------------------------
# I do not agree with these at all, so never load them
[-NamingConventions::ProhibitMixedCaseVars]
[-NamingConventions::ProhibitMixedCaseSubs]
#--------------------------------------------------------------
# For all other Policies, I accept the default severity,
# so no additional configuration is required for them.
--end here--
The problem is that you need to include 'Perl::Critic::Policy' in all of
the header areas in the examples. Otherwise the Critic just skips over
the section and does not complain.
It was irrating for a while because I was trying to turn off some
policies and using samples above just was not working. Once I added the
'Perl::Critic::Policy' it worked. The documentation lead me astray.