Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the Perl-Critic CPAN distribution.

Report information
The Basics
Id: 52038
Status: resolved
Priority: 0/
Queue: Perl-Critic

People
Owner: Nobody in particular
Requestors: djerius [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Critical
Broken in: 1.105
Fixed in: 1.108



Subject: ## no critic call should ignore white spaces in argument list
If there's white space before the leading argument in the ## no critic argument list, the argument list is ignored and *all* policies are ignored, not just those listed. Unfortunately this means that a simple typo will disable all checks. Ouch! For example, ## no critic ( ProhibitAccessOfPrivateData) causes *all* policies to be ignored, while ## no critic (ProhibitAccessOfPrivateData) works as intended. I've attached a short script for which perlcritic should output something like this: % perlcritic -verbose 4 foo.pl Stricture disabled at line 8, column 1. See page 429 of PBP. (Severity: 5) But instead it outputs: % perlcritic -verbose 4 foo.pl foo.pl source OK Thanks, Diab
sample broken usage
Subject: foo.pl
use strict; use warnings; ## no critic ( ProhibitAccessOfPrivateData) $f->{foo} = 1; no strict 'refs';
This hardly looks like a critical problem to me. On the other hand, there is such a thing as cherry picking, and sometimes the problems that get solved are not the important ones but the easy ones. Proposed fix committed as SVN revision 3732.
On Tue Dec 15 00:11:49 2009, WYANT wrote: Show quoted text
> This hardly looks like a critical problem to me. On the other hand, > there is such a thing as cherry picking, and sometimes the problems that > get solved are not the important ones but the easy ones. > > Proposed fix committed as SVN revision 3732.
I thought it important because the additional white space turned off perlcritic entirely, which renders it useless. But I should not quibble, as you've fixed it. Thanks for your effort!