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: 57348
Status: resolved
Priority: 0/
Queue: Perl-Critic

People
Owner: Nobody in particular
Requestors: paul [...] city-fan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: 1.105
Fixed in: (no value)



Subject: t/20_policies.t fails with PPI 1.212
After upgrading from PPI 1.210 to 1.212, t/20_policies.t fails: # Failed test 'NamingConventions::Capitalization - line 4 - Basic Passes' # at t/20_policies.t line 169. # got: '1' # expected: '0' # Violation found: : Package "Acme::12345" does not start with a upper case letter at line 17, column 1. See pages 45,46 of PBP. (package Acme::12345;) # Looks like you failed 1 test of 2361. t/20_policies.t ................................... Dubious, test returned 1 (wstat 256, 0x100) Failed 1/2361 subtests (2 TODO tests unexpectedly succeeded) I suspect that this may be related to the fix for RT#44862 (PPI cannot parse "package Foo::100;" correctly).
On Mon May 10 11:26:15 2010, paul@city-fan.org wrote: Show quoted text
> After upgrading from PPI 1.210 to 1.212, t/20_policies.t fails: > > # Failed test 'NamingConventions::Capitalization - line 4 - Basic
Passes' Show quoted text
> # at t/20_policies.t line 169. > # got: '1' > # expected: '0' > # Violation found: : Package "Acme::12345" does not start with a upper > case letter at line 17, column 1. See pages 45,46 of PBP. (package > Acme::12345;) > # Looks like you failed 1 test of 2361. > t/20_policies.t ................................... > Dubious, test returned 1 (wstat 256, 0x100) > Failed 1/2361 subtests > (2 TODO tests unexpectedly succeeded) > > I suspect that this may be related to the fix for RT#44862 (PPI cannot > parse "package Foo::100;" correctly).
I share your suspicion, since PPI 1.210 incorrectly parsed the package name as 'Foo::', followed by the number 100. This would hide the 100 from Perl::Critic. This appears to have been fixed on March 14 2010, in SVN commit 3783. There is no production version of Perl::Critic containing this fix, but 1.105_03 appears to have it. This release also incorporates other patches, and some new (or at least different) dependencies. The fix essentially allows digits as the starting characters in both the :starts_with_lower and :starts_with_upper capitalization schemes. The CPAN testers have reported a bunch of failures in Build.PL with 1.105_03. If it does not work for you, maybe Makefile.PL will. Another way to get there is to apply the attached patch to Perl::Critic 1.105.
Subject: rt57348.patch
Index: lib/Perl/Critic/Policy/NamingConventions/Capitalization.pm =================================================================== --- lib/Perl/Critic/Policy/NamingConventions/Capitalization.pm (revision 3782) +++ lib/Perl/Critic/Policy/NamingConventions/Capitalization.pm (revision 3783) @@ -41,8 +41,8 @@ qr< \A [@%\$]? (?: [[:lower:]_\d]+ | [[:upper:]_\d]+ ) \z >xms; Readonly::Scalar my $ALL_LOWER_REGEX => qr< \A [[:lower:]_\d]+ \z >xms; Readonly::Scalar my $ALL_UPPER_REGEX => qr< \A [[:upper:]_\d]+ \z >xms; -Readonly::Scalar my $STARTS_WITH_LOWER_REGEX => qr< \A _* [[:lower:]] >xms; -Readonly::Scalar my $STARTS_WITH_UPPER_REGEX => qr< \A _* [[:upper:]] >xms; +Readonly::Scalar my $STARTS_WITH_LOWER_REGEX => qr< \A _* [[:lower:]\d] >xms; +Readonly::Scalar my $STARTS_WITH_UPPER_REGEX => qr< \A _* [[:upper:]\d] >xms; Readonly::Scalar my $NO_RESTRICTION_REGEX => qr< . >xms; Readonly::Hash my %CAPITALIZATION_SCHEME_TAGS => (
Subject: Re: [rt.cpan.org #57348] t/20_policies.t fails with PPI 1.212
Date: Mon, 10 May 2010 22:49:29 -0500
To: bug-Perl-Critic [...] rt.cpan.org
From: Elliot Shank <perl [...] galumph.com>
Perl::Critic 1.106 has been released with only this change made to it.