Jonas,
Honestly I just left the default perlcritic test script in my package as
generated by Module::Starter. This was the first time I had done so, and I
really had no idea about Perl::Critic until last night when my module failed
"smoke" testing after upload to CPAN. From the test script I am guessing
that I cannot alter the verbosity setting (running on someone else's
automated server).
#!perl
if (!require Test::Perl::Critic) {
Test::More::plan(
skip_all => "Test::Perl::Critic required for testing PBP compliance"
);
}
Test::Perl::Critic::all_critic_ok();
Incidentally, I have tried to install P::C today, but I can't get past PPI
(or a dependency). I keep running out of memory (which may be a failing
memory stick in my machine, because it has 8 gigs of RAM). Someday maybe
I'll try again and kill the test that is "sticking":
t/14_charsets....................ok 1/11Out of memory!
It is from: ADAMK/PPI-1.203.tar.gz
Thanks for the suggestion!
Roger
-----Original Message-----
From: Jonas Brømsø Nielsen [mailto:[email protected]]
Sent: Wednesday, February 18, 2009 2:23 PM
To: [email protected]
Cc: 'Bill Ward'; [email protected]
Subject: Re: ARGH! (was FW: Perl Critic and (honest) hash references)
Hi Roger,
How do you perform your perlcritic runs?
I can recommend the verbosity setting 8
perlcritic --verbose 8
This gives you quite friendly policy identifiers
[ValuesAndExpressions::ProhibitConstantPragma] Pragma "constant"
used
at line 22, column 1. (Severity: 4)
well my favorite anyway
jonasbn
On 18/02/2009, at 21.17, Roger Hall wrote:
> I had to dig around in the policy modules because it isn't actually
> listed
> in the other document I linked.
>
> Specifically: ProhibitAccessOfPrivateData
>
> I'm only sure this is it because the error message that came out of
> the
> report ...
>
> "Private Member Data shouldn't be accessed directly at line X,
> column Y.
> Accessing an objects data directly breaks encapsulation and should be
> avoided."
>
> ... is prominently displayed in the module.
>
> Thanks!
>
> Roger
>
> -----Original Message-----
> From: Bill Ward [mailto:[email protected]]
> Sent: Wednesday, February 18, 2009 11:11 AM
> To: [email protected]
> Subject: Re: ARGH! (was FW: Perl Critic and (honest) hash references)
>
> What was the solution?
>
> On Wed, Feb 18, 2009 at 8:53 AM, Roger Hall <[email protected]> wrote:
>> RTFM is always pretty good advice, eh? :}
>>
>> -----Original Message-----
>> From: Roger Hall [mailto:[email protected]]
>> Sent: Wednesday, February 18, 2009 10:05 AM
>> To: [email protected]
>> Subject: Perl Critic and (honest) hash references
>>
>> $config->{query}
>>
>> Perlcritic complains that "Private Member Data shouldn't be accessed
>> directly" because "Accessing an objects data directly breaks
>> encapsulation
>> and should be avoided". I get that. Only problem: it's not an
>> object. It's
>> just a hashref.
>
>