perl-critic Questions
6
Solved
perlcritic complaints that the following code, some boilerplate DBI stuff that works perfectly fine, should croak instead of die:
# Connect to database
my $db_handle = DBI->connect( $url, $user...
Coronado asked 11/11, 2010 at 16:2
1
I want to detect grammar errors in my perl code. I've found that perlcritic misses many of them, (eg a random else inserted before any if, so trying to compile with perl -cw looks like the only via...
Disadvantaged asked 4/9, 2020 at 12:32
1
Solved
Have a simple module
package Rrr;
use 5.014;
use warnings;
use namespace::sweep;
use Moo;
use Method::Signatures::Simple;
BEGIN {
our $VERSION = '0.0.1';
}
has 'root' => (
is => 'rw',
d...
Boldface asked 16/7, 2015 at 15:2
2
Solved
While digging in some old source code I saw the following:
my $module = $some{module};
eval "require $module";
die "Bad module\n$@" if $@;
while I understand what the code does, it tries "requir...
Travelled asked 15/4, 2015 at 22:15
2
Solved
If perlcritic says "having no returns in a sub is wrong", what is the alternative if they really aren't needed?
I've developed two apparently bad habits:
I explicitly assign variables to the '$...
Radiator asked 27/2, 2015 at 9:40
1
I understand that it is best practice to use Modern::Perl rather than use strict and warnings.
With default options, Perl::Critic v1.121 complains about code before strict, even when 'use Modern::P...
Hoffert asked 12/8, 2014 at 6:54
2
I'm new to Perl, and am currently tasked with tidying and maintaining a large and pretty messy Perl project. I'm using perl-critic to help me detect issues in the code (and also to teach me best pr...
Chouinard asked 28/4, 2014 at 8:29
5
Solved
Lately, I've decided to start using Perl::Critic more often on my code. After programming in Perl for close to 7 years now, I've been settled in with most of the Perl best practices for a long whil...
Cluster asked 16/2, 2010 at 18:33
3
Solved
I want to supress output in child process and read only stderr. perlfaq8 advises to do following:
# To capture a program's STDERR, but discard its STDOUT:
use IPC::Open3;
use File::Spec;
use Symbo...
Miso asked 5/12, 2013 at 7:9
1
Solved
We have been using Perl::Critic here at work to enforce our code conventions. Recently we ran into issues with /tmp directory getting filled up due to the Temp::File::tempdir function. tempdir clea...
Moldboard asked 3/12, 2012 at 21:1
4
Solved
I'm trying to exclude checks of Perl Critic's RequireRcsKeywords in a single Perl script. I don't want to change my default policy in .perlcriticrc so I added a "no critic" line to the top of the s...
Mutualize asked 7/2, 2012 at 18:35
1
Solved
Follow code is not accepted by Critic, severity 4:
return {
'debug' => $debug,
'identifier' => $identifier
};
I get this error:
# Perl::Critic found these violations in "filename.pl":
#...
Dael asked 2/2, 2012 at 10:44
2
Solved
I have a script and I am trying to elimate bad practices using perlcritic.
One line I have is as follows:
open(my($FREESPCHK), $cmdline ) || &zdie($MSG_PASSTHRU,"Error checking free space of ...
Kaden asked 19/12, 2011 at 11:58
2
Solved
I've been told it's possible to have Perl::Critic show the policy name that is offending in its output. But I can't recall what I have to do to turn this on. How can this be enabled in a perlcritic...
Deuteranope asked 11/7, 2011 at 20:18
2
Solved
I'm looking for an equivalent of PerlCritic for PHP. PerlCritc is a static source code analyzer that qritiques code and warns about everything from unused variables, to unsafe ways to handle data t...
Worcestershire asked 12/3, 2010 at 12:15
4
PPI and Perl::Critic allow programmers to detect certain things in the syntax of their Perl programs.
Is there anything like it that will tokenize/parse C and give you a chance to write a script t...
Bettyannbettye asked 17/12, 2009 at 19:59
4
Solved
I'm trying to enable PerlCritic support in Komodo.
The official word from ActiveState, the makers of Komodo IDE 5.1 (Win 32) is:
"To enable PerlCritic support, please install the 'Perl-Critic' an...
Cheese asked 11/9, 2009 at 5:14
4
Solved
My department is currently settling on some general code best practices, which we would like to somewhat enforce, providing developers with Perl::Tidy and Perl::Critic configurations.
Now we are h...
Nonsectarian asked 4/9, 2009 at 11:44
5
Solved
I ran Perl::Critic on one of my scripts, and got this message:
Regular expression without "/x" flag at line 21, column 26. See page 236 of PBP.
I looked up the policy information here, and I und...
Jestinejesting asked 12/6, 2009 at 15:48
4
I've started a conversion of a project to Moose and the first thing I noticed was that my critic/tidy tests go to hell. Moose, Tidy and Critic don't seem to like each other as much as they used to....
Defilade asked 18/9, 2008 at 13:21
7
Solved
One I am aware of is Perl::Critic
And my googling has resulted in no results on multiple attempts so far. :-(
Does anyone have any recommendations here?
Any resources to configure Perl::Critic a...
Auxiliaries asked 9/9, 2008 at 10:1
1
© 2022 - 2024 — McMap. All rights reserved.