.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.40) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "Perl::Critic::Pulp 3pm" .TH Perl::Critic::Pulp 3pm "2021-02-28" "perl v5.32.1" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" Perl::Critic::Pulp \- some add\-on perlcritic policies .SH "DESCRIPTION" .IX Header "DESCRIPTION" This is a collection of add-on policies for \f(CW\*(C`Perl::Critic\*(C'\fR. They're under a \*(L"pulp\*(R" theme plus other themes according to their purpose (see \&\*(L"\s-1POLICY THEMES\*(R"\s0 in Perl::Critic). .SS "Bugs" .IX Subsection "Bugs" .IP "CodeLayout::ProhibitFatCommaNewline" 4 .IX Item "CodeLayout::ProhibitFatCommaNewline" Avoid newline before \f(CW\*(C`=>\*(C'\fR not quoting. .IP "CodeLayout::ProhibitIfIfSameLine" 4 .IX Item "CodeLayout::ProhibitIfIfSameLine" Avoid \f(CW\*(C`} if () {\*(C'\fR perhaps meant to be \f(CW\*(C`elsif\*(C'\fR. .IP "Miscellanea::TextDomainPlaceholders" 4 .IX Item "Miscellanea::TextDomainPlaceholders" Check keyword arguments to \f(CW\*(C`_\|_x()\*(C'\fR, \f(CW\*(C`_\|_nx()\*(C'\fR, etc. .IP "Modules::ProhibitUseQuotedVersion" 4 .IX Item "Modules::ProhibitUseQuotedVersion" Don't quote a version requirement like \f(CW\*(C`use Foo \*(Aq1.5\*(Aq\*(C'\fR .IP "ValuesAndExpressions::RequireNumericVersion" 4 .IX Item "ValuesAndExpressions::RequireNumericVersion" \&\f(CW$VERSION\fR plain number for comparisons and checking. .IP "ValuesAndExpressions::ConstantBeforeLt" 4 .IX Item "ValuesAndExpressions::ConstantBeforeLt" Avoid problems with \f(CW\*(C`FOO < 123\*(C'\fR .IP "ValuesAndExpressions::NotWithCompare" 4 .IX Item "ValuesAndExpressions::NotWithCompare" Avoid problems with \f(CW\*(C`! $x == $y\*(C'\fR .IP "ValuesAndExpressions::ProhibitArrayAssignAref" 4 .IX Item "ValuesAndExpressions::ProhibitArrayAssignAref" Dubious \f(CW\*(C`@array=[1,2,3]\*(C'\fR array/arrayref assignments. .IP "ValuesAndExpressions::ProhibitDuplicateHashKeys" 4 .IX Item "ValuesAndExpressions::ProhibitDuplicateHashKeys" Duplicate literal keys \f(CW\*(C`%h = (xyz=>123, xyz=>456)\*(C'\fR. .IP "ValuesAndExpressions::ProhibitFiletest_f" 4 .IX Item "ValuesAndExpressions::ProhibitFiletest_f" Don't use \f(CW\*(C`\-f\*(C'\fR. .IP "ValuesAndExpressions::UnexpandedSpecialLiteral" 4 .IX Item "ValuesAndExpressions::UnexpandedSpecialLiteral" \&\f(CW\*(C`_\|_PACKAGE_\|_\*(C'\fR etc special words not expanding. .SS "Compatibility" .IX Subsection "Compatibility" .IP "Compatibility::ConstantPragmaHash" 4 .IX Item "Compatibility::ConstantPragmaHash" Version requirement for hash style multi-constants. .IP "Compatibility::ConstantLeadingUnderscore" 4 .IX Item "Compatibility::ConstantLeadingUnderscore" Version requirement for constants with leading underscore. .IP "Compatibility::Gtk2Constants" 4 .IX Item "Compatibility::Gtk2Constants" Gtk2 module version requirement for some constants. .IP "Compatibility::PerlMinimumVersionAndWhy" 4 .IX Item "Compatibility::PerlMinimumVersionAndWhy" Perl version declared against features used. .IP "Compatibility::PodMinimumVersion" 4 .IX Item "Compatibility::PodMinimumVersion" Perl version declared against \s-1POD\s0 features used. .IP "Compatibility::ProhibitUnixDevNull" 4 .IX Item "Compatibility::ProhibitUnixDevNull" Prefer \f(CW\*(C`File::Spec\->devnull\*(C'\fR over \fI/dev/null\fR. .SS "Efficiency" .IX Subsection "Efficiency" .IP "Documentation::RequireEndBeforeLastPod" 4 .IX Item "Documentation::RequireEndBeforeLastPod" Put \f(CW\*(C`_\|_END_\|_\*(C'\fR before \s-1POD\s0 at end of file. .IP "Miscellanea::TextDomainUnused" 4 .IX Item "Miscellanea::TextDomainUnused" \&\f(CW\*(C`Locale::TextDomain\*(C'\fR imported but not used. .IP "Modules::ProhibitPOSIXimport" 4 .IX Item "Modules::ProhibitPOSIXimport" Don't import the whole of \f(CW\*(C`POSIX\*(C'\fR. .SS "Cosmetic" .IX Subsection "Cosmetic" .IP "CodeLayout::RequireTrailingCommaAtNewline" 4 .IX Item "CodeLayout::RequireTrailingCommaAtNewline" Comma \*(L",\*(R" at the end of list, if at a newline. .IP "CodeLayout::RequireFinalSemicolon" 4 .IX Item "CodeLayout::RequireFinalSemicolon" Semicolon \f(CW\*(C`;\*(C'\fR on the last statement of a subroutine or block. .IP "ValuesAndExpressions::ProhibitEmptyCommas" 4 .IX Item "ValuesAndExpressions::ProhibitEmptyCommas" Stray consecutive commas \f(CW\*(C`,,\*(C'\fR .IP "ValuesAndExpressions::ProhibitNullStatements" 4 .IX Item "ValuesAndExpressions::ProhibitNullStatements" Stray semicolons \f(CW\*(C`;\*(C'\fR .IP "ValuesAndExpressions::ProhibitUnknownBackslash" 4 .IX Item "ValuesAndExpressions::ProhibitUnknownBackslash" Unknown \f(CW\*(C`\ez\*(C'\fR etc escapes in strings. .IP "ValuesAndExpressions::ProhibitBarewordDoubleColon" 4 .IX Item "ValuesAndExpressions::ProhibitBarewordDoubleColon" Double-colon barewords \f(CW\*(C`Foo::Bar::\*(C'\fR .IP "Modules::ProhibitModuleShebang" 4 .IX Item "Modules::ProhibitModuleShebang" No \f(CW\*(C`#!\*(C'\fR interpreter line in \fI.pm\fR files. .SS "Documentation" .IX Subsection "Documentation" .IP "Documentation::ProhibitUnbalancedParens" 4 .IX Item "Documentation::ProhibitUnbalancedParens" Unbalanced or mismatched ( ) parens, brackets and braces. .IP "Documentation::ProhibitAdjacentLinks" 4 .IX Item "Documentation::ProhibitAdjacentLinks" Put commas or some text between adjacent \f(CW\*(C`L<>\*(C'\fR links. .IP "Documentation::ProhibitDuplicateHeadings" 4 .IX Item "Documentation::ProhibitDuplicateHeadings" Don't duplicate \f(CW\*(C`=head\*(C'\fR headings. .IP "Documentation::ProhibitDuplicateSeeAlso" 4 .IX Item "Documentation::ProhibitDuplicateSeeAlso" Don't duplicate \f(CW\*(C`L<>\*(C'\fR links in \s-1SEE ALSO\s0 sections. .IP "Documentation::ProhibitBadAproposMarkup" 4 .IX Item "Documentation::ProhibitBadAproposMarkup" Avoid \f(CW\*(C`C<>\*(C'\fR in \s-1NAME\s0 section, bad for man's \*(L"apropos\*(R" output. .IP "Documentation::RequireFilenameMarkup" 4 .IX Item "Documentation::RequireFilenameMarkup" Markup /foo filenames. .IP "Documentation::ProhibitLinkToSelf" 4 .IX Item "Documentation::ProhibitLinkToSelf" Don't \f(CW\*(C`L<>\*(C'\fR link to the document itself. .IP "Documentation::ProhibitParagraphEndComma" 4 .IX Item "Documentation::ProhibitParagraphEndComma" Don't end paragraph with \*(L",\*(R" comma. .IP "Documentation::ProhibitParagraphTwoDots" 4 .IX Item "Documentation::ProhibitParagraphTwoDots" Don't end paragraph with \*(L"..\*(R" (stray extra dot). .IP "Documentation::ProhibitVerbatimMarkup" 4 .IX Item "Documentation::ProhibitVerbatimMarkup" Verbatim paragraphs not expanding \f(CW\*(C`C<>\*(C'\fR etc markup. .IP "Documentation::RequireFinalCut" 4 .IX Item "Documentation::RequireFinalCut" Have a \f(CW\*(C`=cut\*(C'\fR at end of file. .IP "Documentation::RequireLinkedURLs" 4 .IX Item "Documentation::RequireLinkedURLs" Use \f(CW\*(C`L<>\*(C'\fR markup on URLs. .SS "Selecting" .IX Subsection "Selecting" You can always enable or disable the policies you do or don't want (see \&\*(L"\s-1CONFIGURATION\*(R"\s0 in Perl::Critic). You may have already realized that there's a wide range of builtin and add-on perlcritic policies ranging from buggy practice to deliberately restrictive or even quite bizarre. You're not meant to pass everything. Some policies may even be mutually contradictory. .PP The restrictive policies are meant as building blocks for a house style. For example \f(CW\*(C`ProhibitBarewordDoubleColon\*(C'\fR here, or something like \&\f(CW\*(C`ProhibitUnlessBlocks\*(C'\fR. They're usually a matter of personal preference, and \*(L"non de gustibus disputandum\*(R" as they say in the classics. Trying to follow all such policies would give away big parts of the language and quite likely result in very un-typical code. .PP Some of the restrictive policies are geared towards beginners. \&\f(CW\*(C`ProhibitUnknownBackslash\*(C'\fR here or \f(CW\*(C`RequireInitializationForLocalVars\*(C'\fR are along those lines. There might for instance be good backslashing which the prohibition doesn't recognise, or local variable initializers make no sense for output variables like \f(CW$!\fR, once you get to the level of knowing to use \&\f(CW\*(C`local\*(C'\fR to preserve such globals. .PP In general the \s-1POD\s0 of each policy is supposed to explain the motivation so you can see whether you want it or not. If you're not turning off or drastically customizing at least half of all policies then you're either not trying or you're much too easily lead! .SH "OTHER NOTES" .IX Header "OTHER NOTES" In most of the perlcritic documentation, including the Pulp add-ons here, policy names appear without the full \f(CW\*(C`Perl::Critic::Policy::...\*(C'\fR class part. In Emacs try \f(CW\*(C`man\-completion.el\*(C'\fR to make \f(CW\*(C`M\-x man\*(C'\fR automatically expand a suffix part at point, or \f(CW\*(C`ffap\-perl\-module.el\*(C'\fR for the same to go to the source. .IP "\(bu" 4 .IP "\(bu" 4 .PP In perlcritic's output you can ask for \f(CW%P\fR to see the full policy package name to run \f(CW\*(C`perldoc\*(C'\fR or copy or follow etc. Here's a good output format you can put in your \fI.perlcriticrc\fR. The file:line:column: part is a style Emacs will recognise. .PP .Vb 1 \& verbose=%f:%l:%c:\en %P\en %m\en .Ve .PP See Perl::Critic::Violation for all available \f(CW\*(C`%\*(C'\fR escapes. \&\f(CW\*(C`perlcritic.el\*(C'\fR which comes with perlcritic has regexp patterns for Emacs to recognise the builtin perlcritic formats, but it's easier to output \&\*(L"file:line:column:\*(R" in the first place. .SH "SEE ALSO" .IX Header "SEE ALSO" Perl::Critic .SH "HOME PAGE" .IX Header "HOME PAGE" .SH "COPYRIGHT" .IX Header "COPYRIGHT" Copyright 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2021 Kevin Ryde .PP Perl-Critic-Pulp is free software; you can redistribute it and/or modify it under the terms of the \s-1GNU\s0 General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. .PP Perl-Critic-Pulp is distributed in the hope that it will be useful, but \&\s-1WITHOUT ANY WARRANTY\s0; without even the implied warranty of \s-1MERCHANTABILITY\s0 or \s-1FITNESS FOR A PARTICULAR PURPOSE.\s0 See the \s-1GNU\s0 General Public License for more details. .PP You should have received a copy of the \s-1GNU\s0 General Public License along with Perl-Critic-Pulp. If not, see .