Search results for "distribution:Perl-Critic Baz"
Perl::Critic - Critique Perl source code for best-practices.
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 Perl::Critic::Policy modules that attempt to...
PETDANCE/Perl-Critic-1.152 - 17 Oct 2023 04:09:08 UTC
perlcritic - Command-line interface to critique Perl source.
"perlcritic" is a Perl source code analyzer. It is the executable front-end to the Perl::Critic engine, which attempts to identify awkward, hard to read, error-prone, or unconventional constructs in your code. Most of the rules are based on Damian Co...
PETDANCE/Perl-Critic-1.152 - 17 Oct 2023 04:09:08 UTC
Perl::Critic::Config - The final derived Perl::Critic configuration, combined from any profile file and command-line parameters.
Perl::Critic::Config takes care of finding and processing user-preferences for Perl::Critic. The Config object defines which Policy modules will be loaded into the Perl::Critic engine and how they should be configured. You should never really need to...
PETDANCE/Perl-Critic-1.152 - 17 Oct 2023 04:09:08 UTC
Perl::Critic::TestUtils - Utility functions for testing new Policies.
This module is used by Perl::Critic only for self-testing. It provides a few handy subroutines for testing new Perl::Critic::Policy modules. Look at the test programs that ship with Perl::Critic for more examples of how to use these subroutines....
PETDANCE/Perl-Critic-1.152 - 17 Oct 2023 04:09:08 UTC
Perl::Critic::DEVELOPER - How to make new Perl::Critic::Policy modules.
For developers who want to create custom coding standards, the following tells how to create a Policy module for Perl::Critic. Although the Perl::Critic distribution already includes a number of Policies based on Damian Conway's book *Perl Best Pract...
PETDANCE/Perl-Critic-1.152 - 17 Oct 2023 04:09:08 UTC
Perl::Critic::Utils::PPI - Utility functions for dealing with PPI objects.
Provides classification of PPI::Elements....
PETDANCE/Perl-Critic-1.152 - 17 Oct 2023 04:09:08 UTC
Perl::Critic::PolicySummary - Descriptions of the Policy modules included with Perl::Critic itself.
The following Policy modules are distributed with Perl::Critic. (There are additional Policies that can be found in add-on distributions.) The Policy modules have been categorized according to the table of contents in Damian Conway's book Perl Best P...
PETDANCE/Perl-Critic-1.152 - 17 Oct 2023 04:09:08 UTC
Perl::Critic::Policy::NamingConventions::Capitalization - Distinguish different program components by case.
Conway recommends to distinguish different program components by case. Normal subroutines, methods and variables are all in lower case. my $foo; # ok my $foo_bar; # ok sub foo {} # ok sub foo_bar {} # ok my $Foo; # not ok my $foo_Bar; # not ok sub Fo...
PETDANCE/Perl-Critic-1.152 - 17 Oct 2023 04:09:08 UTC
Perl::Critic::Policy::References::ProhibitDoubleSigils - Write @{ $array_ref } instead of @$array_ref.
When dereferencing a reference, put braces around the reference to separate the sigils. Especially for newbies, the braces eliminate any potential confusion about the relative precedence of the sigils. push @$array_ref, 'foo', 'bar', 'baz'; #not ok p...
PETDANCE/Perl-Critic-1.152 - 17 Oct 2023 04:09:08 UTC
Perl::Critic::Policy::CodeLayout::RequireTrailingCommas - Put a comma at the end of every multi-line list declaration, including the last one.
Conway suggests that all elements in a multi-line list should be separated by commas, including the last element. This makes it a little easier to re-order the list by cutting and pasting. my @list = ($foo, $bar, $baz); #not ok my @list = ($foo, $bar...
PETDANCE/Perl-Critic-1.152 - 17 Oct 2023 04:09:08 UTC
Perl::Critic::Policy::Variables::ProhibitPunctuationVars - Write $EVAL_ERROR instead of $@.
Perl's vocabulary of punctuation variables such as $!, $., and $^ are perhaps the leading cause of its reputation as inscrutable line noise. The simple alternative is to use the English module to give them clear names. $| = undef; #not ok use English...
PETDANCE/Perl-Critic-1.152 - 17 Oct 2023 04:09:08 UTC
Perl::Critic::Policy::Variables::ProhibitPerl4PackageNames - Use double colon (::) to separate package name components instead of single quotes (').
Perl 5 kept single quotes ("'") as package component separators in order to remain backward compatible with prior "perl"s, but advocated using double colon ("::") instead. In the more than a decade since Perl 5, double colons have been overwhelmingly...
PETDANCE/Perl-Critic-1.152 - 17 Oct 2023 04:09:08 UTC
Perl::Critic::Policy::Miscellanea::ProhibitUselessNoCritic - Remove ineffective "## no critic" annotations.
Sometimes, you may need to use a "## no critic" annotation to work around a false-positive bug in Perl::Critic. But eventually, that bug might get fixed, leaving your code with extra "## no critic" annotations lying about. Or you may use them to loca...
PETDANCE/Perl-Critic-1.152 - 17 Oct 2023 04:09:08 UTC
Perl::Critic::Policy::Modules::ProhibitAutomaticExportation - Export symbols via @EXPORT_OK or %EXPORT_TAGS instead of @EXPORT.
When using Exporter, symbols placed in the @EXPORT variable are automatically exported into the caller's namespace. Although convenient, this practice is not polite, and may cause serious problems if the caller declares the same symbols. The best pra...
PETDANCE/Perl-Critic-1.152 - 17 Oct 2023 04:09:08 UTC
Perl::Critic::Policy::Modules::RequireFilenameMatchesPackage - Package declaration must match filename.
The package declaration should always match the name of the file that contains it. For example, "package Foo::Bar;" should be in a file called "Bar.pm". This makes it easier for developers to figure out which file a symbol comes from when they see it...
PETDANCE/Perl-Critic-1.152 - 17 Oct 2023 04:09:08 UTC
Perl::Critic::Policy::ControlStructures::ProhibitUnreachableCode - Don't write code after an unconditional die, exit, or next.
This policy prohibits code following a statement which unconditionally alters the program flow. This includes calls to "exit", "die", "return", "next", "last" and "goto". Due to common usage, "croak" and "confess" from Carp are also included. Code is...
PETDANCE/Perl-Critic-1.152 - 17 Oct 2023 04:09:08 UTC
Perl::Critic::Policy::Variables::RequireInitializationForLocalVars - Write local $foo = $bar; instead of just local $foo;.
Most people don't realize that a localized copy of a variable does not retain its original value. Unless you initialize the variable when you "local"-ize it, it defaults to "undef". If you want the variable to retain its original value, just initiali...
PETDANCE/Perl-Critic-1.152 - 17 Oct 2023 04:09:08 UTC
Perl::Critic::Policy::RegularExpressions::ProhibitCaptureWithoutTest - Capture variable used outside conditional.
If a regexp match fails, then any capture variables ($1, $2, ...) will be unaffected. They will retain whatever old values they may have had. Therefore it's important to check the return value of a match before using those variables. '12312123' =~ /(...
PETDANCE/Perl-Critic-1.152 - 17 Oct 2023 04:09:08 UTC
Perl::Critic::Policy::InputOutput::RequireBracedFileHandleWithPrint - Write print {$FH} $foo, $bar; instead of print $FH $foo, $bar;.
The "print" and "printf" functions have a unique syntax that supports an optional file handle argument. Conway suggests wrapping this argument in braces to make it visually stand out from the other arguments. When you put braces around any of the spe...
PETDANCE/Perl-Critic-1.152 - 17 Oct 2023 04:09:08 UTC
Perl::Critic::Policy::CodeLayout::ProhibitQuotedWordLists - Write qw(foo bar baz) instead of ('foo', 'bar', 'baz').
Conway doesn't mention this, but I think "qw()" is an underused feature of Perl. Whenever you need to declare a list of one-word literals, the "qw()" operator is wonderfully concise, and makes it easy to add to the list in the future. @list = ('foo',...
PETDANCE/Perl-Critic-1.152 - 17 Oct 2023 04:09:08 UTC