1Perl::Critic(3) User Contributed Perl Documentation Perl::Critic(3)
2
3
4
6 Perl::Critic - Critique Perl source code for best-practices.
7
9 use Perl::Critic;
10 my $file = shift;
11 my $critic = Perl::Critic->new();
12 my @violations = $critic->critique($file);
13 print @violations;
14
16 Perl::Critic is an extensible framework for creating and applying
17 coding standards to Perl source code. Essentially, it is a static
18 source code analysis engine. Perl::Critic is distributed with a number
19 of Perl::Critic::Policy modules that attempt to enforce various coding
20 guidelines. Most Policy modules are based on Damian Conway's book Perl
21 Best Practices. However, Perl::Critic is not limited to PBP and will
22 even support Policies that contradict Conway. You can enable, disable,
23 and customize those Polices through the Perl::Critic interface. You
24 can also create new Policy modules that suit your own tastes.
25
26 For a command-line interface to Perl::Critic, see the documentation for
27 perlcritic. If you want to integrate Perl::Critic with your build
28 process, Test::Perl::Critic provides an interface that is suitable for
29 test programs. Also, Test::Perl::Critic::Progressive is useful for
30 gradually applying coding standards to legacy code. For the ultimate
31 convenience (at the expense of some flexibility) see the criticism
32 pragma.
33
34 Win32 and ActivePerl users can find PPM distributions of Perl::Critic
35 at <http://theoryx5.uwinnipeg.ca/ppms/> and Alexandr Ciornii's
36 downloadable executable at <http://chorny.net/perl/perlcritic.html>.
37
38 If you'd like to try Perl::Critic without installing anything, there is
39 a web-service available at <http://perlcritic.com>. The web-service
40 does not yet support all the configuration features that are available
41 in the native Perl::Critic API, but it should give you a good idea of
42 what it does. You can also invoke the perlcritic web-service from the
43 command-line by doing an HTTP-post, such as one of these:
44
45 $> lwp-request -m POST http://perlcritic.com/perl/critic.pl < MyModule.pm
46 $> wget -q -O - --post-file=MyModule.pm http://perlcritic.com/perl/critic.pl
47 $> curl --data @MyModule.pm http://perlcritic.com/perl/critic.pl
48
49 Please note that the perlcritic web-service is still alpha code. The
50 URL and interface to the service are subject to change.
51
52 Also, ActivePerl includes a very slick graphical interface to Perl-
53 Critic called "perlcritic-gui". You can get a free community edition
54 of ActivePerl from <http://www.activestate.com>.
55
57 This is considered to be a public class. Any changes to its interface
58 will go through a deprecation cycle.
59
61 "new( [ -profile => $FILE, -severity => $N, -theme => $string, -include
62 => \@PATTERNS, -exclude => \@PATTERNS, -top => $N, -only => $B,
63 -profile-strictness => $PROFILE_STRICTNESS_{WARN|FATAL|QUIET}, -force
64 => $B, -verbose => $N ], -color => $B, -pager => $string, -allow-unsafe
65 => $B, -criticism-fatal => $B)"
66 "new()"
67 Returns a reference to a new Perl::Critic object. Most arguments
68 are just passed directly into Perl::Critic::Config, but I have
69 described them here as well. The default value for all arguments
70 can be defined in your .perlcriticrc file. See the "CONFIGURATION"
71 section for more information about that. All arguments are
72 optional key-value pairs as follows:
73
74 -profile is a path to a configuration file. If $FILE is not
75 defined, Perl::Critic::Config attempts to find a .perlcriticrc
76 configuration file in the current directory, and then in your home
77 directory. Alternatively, you can set the "PERLCRITIC" environment
78 variable to point to a file in another location. If a
79 configuration file can't be found, or if $FILE is an empty string,
80 then all Policies will be loaded with their default configuration.
81 See "CONFIGURATION" for more information.
82
83 -severity is the minimum severity level. Only Policy modules that
84 have a severity greater than $N will be applied. Severity values
85 are integers ranging from 1 (least severe violations) to 5 (most
86 severe violations). The default is 5. For a given "-profile",
87 decreasing the "-severity" will usually reveal more Policy
88 violations. You can set the default value for this option in your
89 .perlcriticrc file. Users can redefine the severity level for any
90 Policy in their .perlcriticrc file. See "CONFIGURATION" for more
91 information.
92
93 If it is difficult for you to remember whether severity "5" is the
94 most or least restrictive level, then you can use one of these
95 named values:
96
97 SEVERITY NAME ...is equivalent to... SEVERITY NUMBER
98 --------------------------------------------------------
99 -severity => 'gentle' -severity => 5
100 -severity => 'stern' -severity => 4
101 -severity => 'harsh' -severity => 3
102 -severity => 'cruel' -severity => 2
103 -severity => 'brutal' -severity => 1
104
105 The names reflect how severely the code is criticized: a "gentle"
106 criticism reports only the most severe violations, and so on down
107 to a "brutal" criticism which reports even the most minor
108 violations.
109
110 -theme is special expression that determines which Policies to
111 apply based on their respective themes. For example, the following
112 would load only Policies that have a 'bugs' AND 'pbp' theme:
113
114 my $critic = Perl::Critic->new( -theme => 'bugs && pbp' );
115
116 Unless the "-severity" option is explicitly given, setting "-theme"
117 silently causes the "-severity" to be set to 1. You can set the
118 default value for this option in your .perlcriticrc file. See the
119 "POLICY THEMES" section for more information about themes.
120
121 -include is a reference to a list of string @PATTERNS. Policy
122 modules that match at least one "m/$PATTERN/ixms" will always be
123 loaded, irrespective of all other settings. For example:
124
125 my $critic = Perl::Critic->new(-include => ['layout'] -severity => 4);
126
127 This would cause Perl::Critic to apply all the "CodeLayout::*"
128 Policy modules even though they have a severity level that is less
129 than 4. You can set the default value for this option in your
130 .perlcriticrc file. You can also use "-include" in conjunction
131 with the "-exclude" option. Note that "-exclude" takes precedence
132 over "-include" when a Policy matches both patterns.
133
134 -exclude is a reference to a list of string @PATTERNS. Policy
135 modules that match at least one "m/$PATTERN/ixms" will not be
136 loaded, irrespective of all other settings. For example:
137
138 my $critic = Perl::Critic->new(-exclude => ['strict'] -severity => 1);
139
140 This would cause Perl::Critic to not apply the "RequireUseStrict"
141 and "ProhibitNoStrict" Policy modules even though they have a
142 severity level that is greater than 1. You can set the default
143 value for this option in your .perlcriticrc file. You can also use
144 "-exclude" in conjunction with the "-include" option. Note that
145 "-exclude" takes precedence over "-include" when a Policy matches
146 both patterns.
147
148 -single-policy is a string "PATTERN". Only one policy that matches
149 "m/$PATTERN/ixms" will be used. Policies that do not match will be
150 excluded. This option has precedence over the "-severity",
151 "-theme", "-include", "-exclude", and "-only" options. You can set
152 the default value for this option in your .perlcriticrc file.
153
154 -top is the maximum number of Violations to return when ranked by
155 their severity levels. This must be a positive integer.
156 Violations are still returned in the order that they occur within
157 the file. Unless the "-severity" option is explicitly given,
158 setting "-top" silently causes the "-severity" to be set to 1. You
159 can set the default value for this option in your .perlcriticrc
160 file.
161
162 -only is a boolean value. If set to a true value, Perl::Critic
163 will only choose from Policies that are mentioned in the user's
164 profile. If set to a false value (which is the default), then
165 Perl::Critic chooses from all the Policies that it finds at your
166 site. You can set the default value for this option in your
167 .perlcriticrc file.
168
169 -profile-strictness is an enumerated value, one of
170 "$PROFILE_STRICTNESS_WARN" in Perl::Critic::Utils::Constants (the
171 default), "$PROFILE_STRICTNESS_FATAL" in
172 Perl::Critic::Utils::Constants, and "$PROFILE_STRICTNESS_QUIET" in
173 Perl::Critic::Utils::Constants. If set to
174 "$PROFILE_STRICTNESS_FATAL" in Perl::Critic::Utils::Constants,
175 Perl::Critic will make certain warnings about problems found in a
176 .perlcriticrc or file specified via the -profile option fatal. For
177 example, Perl::Critic normally only "warn"s about profiles
178 referring to non-existent Policies, but this value makes this
179 situation fatal. Correspondingly, "$PROFILE_STRICTNESS_QUIET" in
180 Perl::Critic::Utils::Constants makes Perl::Critic shut up about
181 these things.
182
183 -force is a boolean value that controls whether Perl::Critic
184 observes the magical "## no critic" annotations in your code. If
185 set to a true value, Perl::Critic will analyze all code. If set to
186 a false value (which is the default) Perl::Critic will ignore code
187 that is tagged with these annotations. See "BENDING THE RULES" for
188 more information. You can set the default value for this option in
189 your .perlcriticrc file.
190
191 -verbose can be a positive integer (from 1 to 11), or a literal
192 format specification. See Perl::Critic::Violation for an
193 explanation of format specifications. You can set the default
194 value for this option in your .perlcriticrc file.
195
196 -unsafe directs Perl::Critic to allow the use of Policies that are
197 marked as "unsafe" by the author. Such policies may compile
198 untrusted code or do other nefarious things.
199
200 -color and -pager are not used by Perl::Critic but is provided for
201 the benefit of perlcritic.
202
203 -criticism-fatal is not used by Perl::Critic but is provided for
204 the benefit of criticism.
205
206 -color-severity-highest, -color-severity-high,
207 -color-severity-medium, -color-severity-low, and
208 -color-severity-lowest are not used by Perl::Critic, but are
209 provided for the benefit of perlcritic. Each is set to the
210 Term::ANSIColor color specification to be used to display
211 violations of the corresponding severity.
212
213 -files-with-violations and -files-without-violations are not used
214 by Perl::Critic, but are provided for the benefit of perlcritic, to
215 cause only the relevant filenames to be displayed.
216
218 "critique( $source_code )"
219 Runs the $source_code through the Perl::Critic engine using all the
220 Policies that have been loaded into this engine. If $source_code
221 is a scalar reference, then it is treated as a string of actual
222 Perl code. If $source_code is a reference to an instance of
223 PPI::Document, then that instance is used directly. Otherwise, it
224 is treated as a path to a local file containing Perl code. This
225 method returns a list of Perl::Critic::Violation objects for each
226 violation of the loaded Policies. The list is sorted in the order
227 that the Violations appear in the code. If there are no
228 violations, this method returns an empty list.
229
230 "add_policy( -policy => $policy_name, -params => \%param_hash )"
231 Creates a Policy object and loads it into this Critic. If the
232 object cannot be instantiated, it will throw a fatal exception.
233 Otherwise, it returns a reference to this Critic.
234
235 -policy is the name of a Perl::Critic::Policy subclass module. The
236 'Perl::Critic::Policy' portion of the name can be omitted for
237 brevity. This argument is required.
238
239 -params is an optional reference to a hash of Policy parameters.
240 The contents of this hash reference will be passed into to the
241 constructor of the Policy module. See the documentation in the
242 relevant Policy module for a description of the arguments it
243 supports.
244
245 " policies() "
246 Returns a list containing references to all the Policy objects that
247 have been loaded into this engine. Objects will be in the order
248 that they were loaded.
249
250 " config() "
251 Returns the Perl::Critic::Config object that was created for or
252 given to this Critic.
253
254 " statistics() "
255 Returns the Perl::Critic::Statistics object that was created for
256 this Critic. The Statistics object accumulates data for all files
257 that are analyzed by this Critic.
258
260 For those folks who prefer to have a functional interface, The
261 "critique" method can be exported on request and called as a static
262 function. If the first argument is a hashref, its contents are used to
263 construct a new Perl::Critic object internally. The keys of that hash
264 should be the same as those supported by the "Perl::Critic::new"
265 method. Here are some examples:
266
267 use Perl::Critic qw(critique);
268
269 # Use default parameters...
270 @violations = critique( $some_file );
271
272 # Use custom parameters...
273 @violations = critique( {-severity => 2}, $some_file );
274
275 # As a one-liner
276 %> perl -MPerl::Critic=critique -e 'print critique(shift)' some_file.pm
277
278 None of the other object-methods are currently supported as static
279 functions. Sorry.
280
282 Most of the settings for Perl::Critic and each of the Policy modules
283 can be controlled by a configuration file. The default configuration
284 file is called .perlcriticrc. Perl::Critic will look for this file in
285 the current directory first, and then in your home directory.
286 Alternatively, you can set the "PERLCRITIC" environment variable to
287 explicitly point to a different file in another location. If none of
288 these files exist, and the "-profile" option is not given to the
289 constructor, then all the modules that are found in the
290 Perl::Critic::Policy namespace will be loaded with their default
291 configuration.
292
293 The format of the configuration file is a series of INI-style blocks
294 that contain key-value pairs separated by '='. Comments should start
295 with '#' and can be placed on a separate line or after the name-value
296 pairs if you desire.
297
298 Default settings for Perl::Critic itself can be set before the first
299 named block. For example, putting any or all of these at the top of
300 your configuration file will set the default value for the
301 corresponding constructor argument.
302
303 severity = 3 #Integer or named level
304 only = 1 #Zero or One
305 force = 0 #Zero or One
306 verbose = 4 #Integer or format spec
307 top = 50 #A positive integer
308 theme = (pbp || security) && bugs #A theme expression
309 include = NamingConventions ClassHierarchies #Space-delimited list
310 exclude = Variables Modules::RequirePackage #Space-delimited list
311 criticism-fatal = 1 #Zero or One
312 color = 1 #Zero or One
313 allow-unsafe = 1 #Zero or One
314 pager = less #pager to pipe output to
315
316 The remainder of the configuration file is a series of blocks like
317 this:
318
319 [Perl::Critic::Policy::Category::PolicyName]
320 severity = 1
321 set_themes = foo bar
322 add_themes = baz
323 maximum_violations_per_document = 57
324 arg1 = value1
325 arg2 = value2
326
327 "Perl::Critic::Policy::Category::PolicyName" is the full name of a
328 module that implements the policy. The Policy modules distributed with
329 Perl::Critic have been grouped into categories according to the table
330 of contents in Damian Conway's book Perl Best Practices. For brevity,
331 you can omit the 'Perl::Critic::Policy' part of the module name.
332
333 "severity" is the level of importance you wish to assign to the Policy.
334 All Policy modules are defined with a default severity value ranging
335 from 1 (least severe) to 5 (most severe). However, you may disagree
336 with the default severity and choose to give it a higher or lower
337 severity, based on your own coding philosophy. You can set the
338 "severity" to an integer from 1 to 5, or use one of the equivalent
339 names:
340
341 SEVERITY NAME ...is equivalent to... SEVERITY NUMBER
342 ----------------------------------------------------
343 gentle 5
344 stern 4
345 harsh 3
346 cruel 2
347 brutal 1
348
349 The names reflect how severely the code is criticized: a "gentle"
350 criticism reports only the most severe violations, and so on down to a
351 "brutal" criticism which reports even the most minor violations.
352
353 "set_themes" sets the theme for the Policy and overrides its default
354 theme. The argument is a string of one or more whitespace-delimited
355 alphanumeric words. Themes are case-insensitive. See "POLICY THEMES"
356 for more information.
357
358 "add_themes" appends to the default themes for this Policy. The
359 argument is a string of one or more whitespace-delimited words. Themes
360 are case-insensitive. See "POLICY THEMES" for more information.
361
362 "maximum_violations_per_document" limits the number of Violations the
363 Policy will return for a given document. Some Policies have a default
364 limit; see the documentation for the individual Policies to see whether
365 there is one. To force a Policy to not have a limit, specify
366 "no_limit" or the empty string for the value of this parameter.
367
368 The remaining key-value pairs are configuration parameters that will be
369 passed into the constructor for that Policy. The constructors for most
370 Policy objects do not support arguments, and those that do should have
371 reasonable defaults. See the documentation on the appropriate Policy
372 module for more details.
373
374 Instead of redefining the severity for a given Policy, you can
375 completely disable a Policy by prepending a '-' to the name of the
376 module in your configuration file. In this manner, the Policy will
377 never be loaded, regardless of the "-severity" given to the
378 Perl::Critic constructor.
379
380 A simple configuration might look like this:
381
382 #--------------------------------------------------------------
383 # I think these are really important, so always load them
384
385 [TestingAndDebugging::RequireUseStrict]
386 severity = 5
387
388 [TestingAndDebugging::RequireUseWarnings]
389 severity = 5
390
391 #--------------------------------------------------------------
392 # I think these are less important, so only load when asked
393
394 [Variables::ProhibitPackageVars]
395 severity = 2
396
397 [ControlStructures::ProhibitPostfixControls]
398 allow = if unless # My custom configuration
399 severity = cruel # Same as "severity = 2"
400
401 #--------------------------------------------------------------
402 # Give these policies a custom theme. I can activate just
403 # these policies by saying `perlcritic -theme larry`
404
405 [Modules::RequireFilenameMatchesPackage]
406 add_themes = larry
407
408 [TestingAndDebugging::RequireTestLables]
409 add_themes = larry curly moe
410
411 #--------------------------------------------------------------
412 # I do not agree with these at all, so never load them
413
414 [-NamingConventions::Capitalization]
415 [-ValuesAndExpressions::ProhibitMagicNumbers]
416
417 #--------------------------------------------------------------
418 # For all other Policies, I accept the default severity,
419 # so no additional configuration is required for them.
420
421 For additional configuration examples, see the perlcriticrc file that
422 is included in this examples directory of this distribution.
423
424 Damian Conway's own Perl::Critic configuration is also included in this
425 distribution as examples/perlcriticrc-conway.
426
428 A large number of Policy modules are distributed with Perl::Critic.
429 They are described briefly in the companion document
430 Perl::Critic::PolicySummary and in more detail in the individual
431 modules themselves. Say "perlcritic -doc PATTERN" to see the perldoc
432 for all Policy modules that match the regex "m/PATTERN/ixms"
433
434 There are a number of distributions of additional policies on CPAN. If
435 Perl::Critic doesn't contain a policy that you want, some one may have
436 already written it. See the "SEE ALSO" section below for a list of
437 some of these distributions.
438
440 Each Policy is defined with one or more "themes". Themes can be used
441 to create arbitrary groups of Policies. They are intended to provide
442 an alternative mechanism for selecting your preferred set of Policies.
443 For example, you may wish disable a certain subset of Policies when
444 analyzing test programs. Conversely, you may wish to enable only a
445 specific subset of Policies when analyzing modules.
446
447 The Policies that ship with Perl::Critic have been broken into the
448 following themes. This is just our attempt to provide some basic
449 logical groupings. You are free to invent new themes that suit your
450 needs.
451
452 THEME DESCRIPTION
453 --------------------------------------------------------------------------
454 core All policies that ship with Perl::Critic
455 pbp Policies that come directly from "Perl Best Practices"
456 bugs Policies that that prevent or reveal bugs
457 maintenance Policies that affect the long-term health of the code
458 cosmetic Policies that only have a superficial effect
459 complexity Policies that specificaly relate to code complexity
460 security Policies that relate to security issues
461 tests Policies that are specific to test programs
462
463 Any Policy may fit into multiple themes. Say "perlcritic -list" to get
464 a listing of all available Policies and the themes that are associated
465 with each one. You can also change the theme for any Policy in your
466 .perlcriticrc file. See the "CONFIGURATION" section for more
467 information about that.
468
469 Using the "-theme" option, you can create an arbitrarily complex rule
470 that determines which Policies will be loaded. Precedence is the same
471 as regular Perl code, and you can use parentheses to enforce precedence
472 as well. Supported operators are:
473
474 Operator Altertative Example
475 -----------------------------------------------------------------
476 && and 'pbp && core'
477 || or 'pbp || (bugs && security)'
478 ! not 'pbp && ! (portability || complexity)'
479
480 Theme names are case-insensitive. If the "-theme" is set to an empty
481 string, then it evaluates as true all Policies.
482
484 Perl::Critic takes a hard-line approach to your code: either you comply
485 or you don't. In the real world, it is not always practical (nor even
486 possible) to fully comply with coding standards. In such cases, it is
487 wise to show that you are knowingly violating the standards and that
488 you have a Damn Good Reason (DGR) for doing so.
489
490 To help with those situations, you can direct Perl::Critic to ignore
491 certain lines or blocks of code by using annotations:
492
493 require 'LegacyLibaray1.pl'; ## no critic
494 require 'LegacyLibrary2.pl'; ## no critic
495
496 for my $element (@list) {
497
498 ## no critic
499
500 $foo = ""; #Violates 'ProhibitEmptyQuotes'
501 $barf = bar() if $foo; #Violates 'ProhibitPostfixControls'
502 #Some more evil code...
503
504 ## use critic
505
506 #Some good code...
507 do_something($_);
508 }
509
510 The "## no critic" annotations direct Perl::Critic to ignore the
511 remaining lines of code until a "## use critic" annotation is found. If
512 the "## no critic" annotation is on the same line as a code statement,
513 then only that line of code is overlooked. To direct perlcritic to
514 ignore the "## no critic" annotations, use the "--force" option.
515
516 A bare "## no critic" annotation disables all the active Policies. If
517 you wish to disable only specific Policies, add a list of Policy names
518 as arguments, just as you would for the "no strict" or "no warnings"
519 pragmas. For example, this would disable the "ProhibitEmptyQuotes" and
520 "ProhibitPostfixControls" policies until the end of the block or until
521 the next "## use critic" annotation (whichever comes first):
522
523 ## no critic (EmptyQuotes, PostfixControls)
524
525 # Now exempt from ValuesAndExpressions::ProhibitEmptyQuotes
526 $foo = "";
527
528 # Now exempt ControlStructures::ProhibitPostfixControls
529 $barf = bar() if $foo;
530
531 # Still subjected to ValuesAndExpression::RequireNumberSeparators
532 $long_int = 10000000000;
533
534 Since the Policy names are matched against the "## no critic" arguments
535 as regular expressions, you can abbreviate the Policy names or disable
536 an entire family of Policies in one shot like this:
537
538 ## no critic (NamingConventions)
539
540 # Now exempt from NamingConventions::Capitalization
541 my $camelHumpVar = 'foo';
542
543 # Now exempt from NamingConventions::Capitalization
544 sub camelHumpSub {}
545
546 The argument list must be enclosed in parentheses and must contain one
547 or more comma-separated barewords (e.g. don't use quotes). The "## no
548 critic" annotations can be nested, and Policies named by an inner
549 annotation will be disabled along with those already disabled an outer
550 annotation.
551
552 Some Policies like "Subroutines::ProhibitExcessComplexity" apply to an
553 entire block of code. In those cases, "## no critic" must appear on
554 the line where the violation is reported. For example:
555
556 sub complicated_function { ## no critic (ProhibitExcessComplexity)
557 # Your code here...
558 }
559
560 Policies such as "Documentation::RequirePodSections" apply to the
561 entire document, in which case violations are reported at line 1.
562
563 Use this feature wisely. "## no critic" annotations should be used in
564 the smallest possible scope, or only on individual lines of code. And
565 you should always be as specific as possible about which Policies you
566 want to disable (i.e. never use a bare "## no critic"). If
567 Perl::Critic complains about your code, try and find a compliant
568 solution before resorting to this feature.
569
571 Coding standards are deeply personal and highly subjective. The goal
572 of Perl::Critic is to help you write code that conforms with a set of
573 best practices. Our primary goal is not to dictate what those
574 practices are, but rather, to implement the practices discovered by
575 others. Ultimately, you make the rules -- Perl::Critic is merely a
576 tool for encouraging consistency. If there is a policy that you think
577 is important or that we have overlooked, we would be very grateful for
578 contributions, or you can simply load your own private set of policies
579 into Perl::Critic.
580
582 The modular design of Perl::Critic is intended to facilitate the
583 addition of new Policies. You'll need to have some understanding of
584 PPI, but most Policy modules are pretty straightforward and only
585 require about 20 lines of code. Please see the Perl::Critic::DEVELOPER
586 file included in this distribution for a step-by-step demonstration of
587 how to create new Policy modules.
588
589 If you develop any new Policy modules, feel free to send them to
590 "<jeff@imaginative-software.com>" and I'll be happy to put them into
591 the Perl::Critic distribution. Or if you would like to work on the
592 Perl::Critic project directly, check out our repository at
593 <http://perlcritic.tigris.org>. To subscribe to our mailing list, send
594 a message to <mailto:dev-subscribe@perlcritic.tigris.org>.
595
596 The Perl::Critic team is also available for hire. If your organization
597 has its own coding standards, we can create custom Policies to enforce
598 your local guidelines. Or if your code base is prone to a particular
599 defect pattern, we can design Policies that will help you catch those
600 costly defects before they go into production. To discuss your needs
601 with the Perl::Critic team, just contact
602 "<jeff@imaginative-software.com>".
603
605 Perl::Critic requires the following modules:
606
607 B::Keywords
608
609 Config::Tiny
610
611 Email::Address
612
613 Exception::Class
614
615 File::Spec
616
617 File::Spec::Unix
618
619 IO::String
620
621 List::MoreUtils
622
623 List::Util
624
625 Module::Pluggable
626
627 Perl::Tidy
628
629 Pod::Spell
630
631 PPI
632
633 Pod::PlainText
634
635 Pod::Select
636
637 Pod::Usage
638
639 Readonly
640
641 Scalar::Util
642
643 String::Format
644
645 Task::Weaken
646
647 Text::ParseWords
648
649 version
650
651 The following modules are optional, but recommended for complete
652 functionality:
653
654 File::HomeDir
655
656 File::Which
657
659 You are encouraged to subscribe to the mailing list; send a message to
660 <mailto:users-subscribe@perlcritic.tigris.org>. See also the archives
661 at
662 <http://perlcritic.tigris.org/servlets/SummarizeList?listName=users>.
663 You can also contact the author at "<jeff@imaginative-software.com>".
664
665 At least one member of the development team has started hanging around
666 in <irc://irc.perl.org/#perlcritic>.
667
668 You can also follow Perl::Critic on Twitter, at
669 <https://twitter.com/perlcritic>.
670
672 There are a number of distributions of additional Policies available.
673 A few are listed here:
674
675 Perl::Critic::More
676
677 Perl::Critic::Bangs
678
679 Perl::Critic::Lax
680
681 Perl::Critic::StricterSubs
682
683 Perl::Critic::Swift
684
685 Perl::Critic::Tics
686
687 These distributions enable you to use Perl::Critic in your unit tests:
688
689 Test::Perl::Critic
690
691 Test::Perl::Critic::Progressive
692
693 There is also a distribution that will install all the Perl::Critic
694 related modules known to the development team:
695
696 Task::Perl::Critic
697
698 If you want to make sure you have absolutely everything, you can use
699 this:
700
701 Task::Perl::Critic::IncludingOptionalDependencies
702
704 Scrutinizing Perl code is hard for humans, let alone machines. If you
705 find any bugs, particularly false-positives or false-negatives from a
706 Perl::Critic::Policy, please submit them to
707 <http://rt.cpan.org/NoAuth/Bugs.html?Dist=Perl-Critic>. Thanks.
708
709 Most policies will produce false-negatives if they cannot understand a
710 particular block of code.
711
713 Adam Kennedy - For creating PPI, the heart and soul of Perl::Critic.
714
715 Damian Conway - For writing Perl Best Practices, finally :)
716
717 Chris Dolan - For contributing the best features and Policy modules.
718
719 Andy Lester - Wise sage and master of all-things-testing.
720
721 Elliot Shank - The self-proclaimed quality freak.
722
723 Giuseppe Maxia - For all the great ideas and positive encouragement.
724
725 and Sharon, my wife - For putting up with my all-night code sessions.
726
727 Thanks also to the Perl Foundation for providing a grant to support
728 Chris Dolan's project to implement twenty PBP policies.
729 <http://www.perlfoundation.org/april_1_2007_new_grant_awards>
730
732 Jeffrey Ryan Thalhammer <jeff@imaginative-software.com>
733
735 Copyright (c) 2005-2011 Imaginative Software Systems. All rights
736 reserved.
737
738 This program is free software; you can redistribute it and/or modify it
739 under the same terms as Perl itself. The full text of this license can
740 be found in the LICENSE file included with this module.
741
742
743
744perl v5.16.3 2014-06-09 Perl::Critic(3)