1Perl::Critic::Pulp(3) User Contributed Perl DocumentationPerl::Critic::Pulp(3)
2
3
4

NAME

6       Perl::Critic::Pulp - some add-on perlcritic policies
7

DESCRIPTION

9       This is a collection of add-on policies for "Perl::Critic".  They're
10       under a "pulp" theme plus other themes according to their purpose (see
11       "POLICY THEMES" in Perl::Critic).
12
13   Bugs
14       CodeLayout::ProhibitFatCommaNewline
15           Avoid newline before "=>" not quoting.
16
17       CodeLayout::ProhibitIfIfSameLine
18           Avoid "} if () {" perhaps meant to be "elsif".
19
20       Miscellanea::TextDomainPlaceholders
21           Check keyword arguments to "__x()", "__nx()", etc.
22
23       Modules::ProhibitUseQuotedVersion
24           Don't quote a version requirement like "use Foo '1.5'"
25
26       ValuesAndExpressions::RequireNumericVersion
27           $VERSION plain number for comparisons and checking.
28
29       ValuesAndExpressions::ConstantBeforeLt
30           Avoid problems with "FOO < 123"
31
32       ValuesAndExpressions::NotWithCompare
33           Avoid problems with "! $x == $y"
34
35       ValuesAndExpressions::ProhibitArrayAssignAref
36           Dubious "@array=[1,2,3]" array/arrayref assignments.
37
38       ValuesAndExpressions::ProhibitDuplicateHashKeys
39           Duplicate literal keys "%h = (xyz=>123, xyz=>456)".
40
41       ValuesAndExpressions::ProhibitFiletest_f
42           Don't use "-f".
43
44       ValuesAndExpressions::UnexpandedSpecialLiteral
45           "__PACKAGE__" etc special words not expanding.
46
47   Compatibility
48       Compatibility::ConstantPragmaHash
49           Version requirement for hash style multi-constants.
50
51       Compatibility::ConstantLeadingUnderscore
52           Version requirement for constants with leading underscore.
53
54       Compatibility::Gtk2Constants
55           Gtk2 module version requirement for some constants.
56
57       Compatibility::PerlMinimumVersionAndWhy
58           Perl version declared against features used.
59
60       Compatibility::PodMinimumVersion
61           Perl version declared against POD features used.
62
63       Compatibility::ProhibitUnixDevNull
64           Prefer "File::Spec->devnull" over /dev/null.
65
66   Efficiency
67       Documentation::RequireEndBeforeLastPod
68           Put "__END__" before POD at end of file.
69
70       Miscellanea::TextDomainUnused
71           "Locale::TextDomain" imported but not used.
72
73       Modules::ProhibitPOSIXimport
74           Don't import the whole of "POSIX".
75
76   Cosmetic
77       CodeLayout::RequireTrailingCommaAtNewline
78           Comma "," at the end of list, if at a newline.
79
80       CodeLayout::RequireFinalSemicolon
81           Semicolon ";" on the last statement of a subroutine or block.
82
83       ValuesAndExpressions::ProhibitEmptyCommas
84           Stray consecutive commas ",,"
85
86       ValuesAndExpressions::ProhibitNullStatements
87           Stray semicolons ";"
88
89       ValuesAndExpressions::ProhibitUnknownBackslash
90           Unknown "\z" etc escapes in strings.
91
92       ValuesAndExpressions::ProhibitBarewordDoubleColon
93           Double-colon barewords "Foo::Bar::"
94
95       Modules::ProhibitModuleShebang
96           No "#!" interpreter line in .pm files.
97
98   Documentation
99       Documentation::ProhibitUnbalancedParens
100           Unbalanced or mismatched ( ) parens, brackets and braces.
101
102       Documentation::ProhibitAdjacentLinks
103           Put commas or some text between adjacent "L<>" links.
104
105       Documentation::ProhibitDuplicateHeadings
106           Don't duplicate "=head" headings.
107
108       Documentation::ProhibitDuplicateSeeAlso
109           Don't duplicate "L<>" links in SEE ALSO sections.
110
111       Documentation::ProhibitBadAproposMarkup
112           Avoid "C<>" in NAME section, bad for man's "apropos" output.
113
114       Documentation::RequireFilenameMarkup
115           Markup /foo filenames.
116
117       Documentation::ProhibitLinkToSelf
118           Don't "L<>" link to the document itself.
119
120       Documentation::ProhibitParagraphEndComma
121           Don't end paragraph with "," comma.
122
123       Documentation::ProhibitParagraphTwoDots
124           Don't end paragraph with ".." (stray extra dot).
125
126       Documentation::ProhibitVerbatimMarkup
127           Verbatim paragraphs not expanding "C<>" etc markup.
128
129       Documentation::RequireFinalCut
130           Have a "=cut" at end of file.
131
132       Documentation::RequireLinkedURLs
133           Use "L<>" markup on URLs.
134
135   Selecting
136       You can always enable or disable the policies you do or don't want (see
137       "CONFIGURATION" in Perl::Critic).  You may have already realized that
138       there's a wide range of builtin and add-on perlcritic policies ranging
139       from buggy practice to deliberately restrictive or even quite bizarre.
140       You're not meant to pass everything.  Some policies may even be
141       mutually contradictory.
142
143       The restrictive policies are meant as building blocks for a house
144       style.  For example "ProhibitBarewordDoubleColon" here, or something
145       like "ProhibitUnlessBlocks".  They're usually a matter of personal
146       preference, and "non de gustibus disputandum" as they say in the
147       classics.  Trying to follow all such policies would give away big parts
148       of the language and quite likely result in very un-typical code.
149
150       Some of the restrictive policies are geared towards beginners.
151       "ProhibitUnknownBackslash" here or "RequireInitializationForLocalVars"
152       are along those lines.  There might for instance be good backslashing
153       which the prohibition doesn't recognise, or local variable initializers
154       make no sense for output variables like $!, once you get to the level
155       of knowing to use "local" to preserve such globals.
156
157       In general the POD of each policy is supposed to explain the motivation
158       so you can see whether you want it or not.  If you're not turning off
159       or drastically customizing at least half of all policies then you're
160       either not trying or you're much too easily lead!
161

OTHER NOTES

163       In most of the perlcritic documentation, including the Pulp add-ons
164       here, policy names appear without the full "Perl::Critic::Policy::..."
165       class part.  In Emacs try "man-completion.el" to make "M-x man"
166       automatically expand a suffix part at point, or "ffap-perl-module.el"
167       for the same to go to the source.
168
169       •   <http://user42.tuxfamily.org/man-completion/index.html>
170
171       •   <http://user42.tuxfamily.org/ffap-perl-module/index.html>
172
173       In perlcritic's output you can ask for %P to see the full policy
174       package name to run "perldoc" or copy or follow etc.  Here's a good
175       output format you can put in your .perlcriticrc.  The file:line:column:
176       part is a style Emacs will recognise.
177
178           verbose=%f:%l:%c:\n %P\n %m\n
179
180       See Perl::Critic::Violation for all available "%" escapes.
181       "perlcritic.el" which comes with perlcritic has regexp patterns for
182       Emacs to recognise the builtin perlcritic formats, but it's easier to
183       output "file:line:column:" in the first place.
184

SEE ALSO

186       Perl::Critic
187

HOME PAGE

189       <http://user42.tuxfamily.org/perl-critic-pulp/index.html>
190
192       Copyright 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017,
193       2018, 2019, 2021 Kevin Ryde
194
195       Perl-Critic-Pulp is free software; you can redistribute it and/or
196       modify it under the terms of the GNU General Public License as
197       published by the Free Software Foundation; either version 3, or (at
198       your option) any later version.
199
200       Perl-Critic-Pulp is distributed in the hope that it will be useful, but
201       WITHOUT ANY WARRANTY; without even the implied warranty of
202       MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
203       General Public License for more details.
204
205       You should have received a copy of the GNU General Public License along
206       with Perl-Critic-Pulp.  If not, see <http://www.gnu.org/licenses/>.
207
208
209
210perl v5.34.0                      2021-07-22             Perl::Critic::Pulp(3)
Impressum