perl-critic

Are there any good automated frameworks for applying coding standards in Perl?

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 as per our coding standards and run it on code base would be appreciated. ...

Perl::Critic: Life after Moose?

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 each other as much as they used to. Are there docs anywhere on how to make critic/tidy be more appreciative if the Moose dialect? What do most Moose users do? Relax/ditch ...

Is there a better way to write Perl regexes with /x so the code is still easy to read?

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 understand that writing regular expressions in extended mode will help anyone who is looking at the code. However, I am stuck as how to convert ...

How can we catch side comments using Perl::Tidy or Perl::Critic?

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 having problems with side comments. The side comment is this: my $counter = 0; # Reset counter We would prefer to not have side comments at...

How do I enable PerlCritic support in Komodo IDE 5.1 on Windows?

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' and 'criticism' modules." Well, installing Perl-Critic was a piece of cake: ppm install Bundle-Perl-Critic However, I've search every reposi...

How can I avoid Perl::Critic warnings when I process a multi-line string with a filehandle?

Does anyone have a solution to the task of processing a multi-line string one line at a time, other than the string-as-a-filehandle solution shown below? my $multiline_string = "line one\nline two\nline three\nline four"; my $filehandle; open( $filehandle, '<', \$multiline_string ) or croak("Can't open multi-line string as a filehan...

Do I need to trap errors in my calls to Win32::OLE->LastError?

[EDIT] - with the benefit of hindsight, this question was misdirected. I have not deleted it because it is a good example of the incorrect use of eval and correct criticism by Perl::Critic. Perl Critic raises the following criticism for the code below: Return value of eval not tested. You can't depend upon the value of $@/$EVAL_ERR...

How can I run Test::Perl::Critic in parallel?

I've written a simple test case based on Test::Perl::Critic which runs critic on every single source file in the repository (all_critic_ok). However, this test takes a long time, especially since I also use a Perl::Tidy policy. Normally, criticizing different files is not dependent on other critics, so I thought I could parallelize tho...

Is there anything like PPI or Perl::Critic for C?

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 to do something with that information? ...

How do I get Perl::Critic to work with E.P.I.C and eclipse?

I'm running eclipse Galileo with EPIC 0.5.46 and ActiveState ActivePerl 5.10.0, on WinXP SP3. I just downloaded Perl::Critic using the package manager, and integrated it to eclipse using the appropriate Properties page. I can run Perl::Critic just fine from my eclipse source context menu; it runs. But it doesn't put any markers in...

Why does Perl::Critic dislike using shift to populate subroutine variables?

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 while, but I know that there is always room for improvement. One thing that has been bugging me though is the fact that Perl::Critic doesn't lik...

Critiquing PHP-code / PerlCritic for PHP?

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 to almost anything. Is there such a thing for PHP that could (preferably) be run outside of an IDE, so that source code analysis could be auto...