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

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

Bug Information
Severity: Normal
Broken in: (no value)
Fixed in: 0.22



Subject: allow Rcs keywords in POD
Putting $Id$ in the POD can be great: people can see just what release they have (even if it's an internal, non-CPAN module) from perldoc. Unfortunately, RequireRcsKeywords does not have PPI::Token::Pod in its _wanted callback. That's a nice easy fix! -- rjbs
Subject: Re: [rt.cpan.org #22890] allow Rcs keywords in POD
Date: Wed, 8 Nov 2006 08:55:32 -0800 (PST)
To: bug-Perl-Critic [...] rt.cpan.org
From: Jeffrey Thalhammer <jeffrey_thalhammer [...] yahoo.com>
I haven't tried this yet, but if I understand the problem correctly, you should be getting a false failure when you put the RCS keywords inside the POD. Is that correct? -Jeff Show quoted text
> Putting $Id$ in the POD can be great: people can see > just what release > they have (even if it's an internal, non-CPAN > module) from perldoc. > Unfortunately, RequireRcsKeywords does not have > PPI::Token::Pod in its > _wanted callback. That's a nice easy fix! > > -- > rjbs >
Show quoted text
____________________________________________________________________________________ Sponsored Link Try Netflix today! With plans starting at only $5.99 a month what are you waiting for? http://www.netflix.com/Signup?mqso=80010030
From: rjbs [...] cpan.org
On Wed Nov 08 11:56:23 2006, jeffrey_thalhammer@yahoo.com wrote: Show quoted text
> I haven't tried this yet, but if I understand the > problem correctly, you should be getting a false > failure when you put the RCS keywords inside the POD. > Is that correct?
That's right.
Patched attached. -- rjbs
diff -Nur Perl-Critic-0.21/lib/Perl/Critic/Policy/Miscellanea/RequireRcsKeywords.pm Perl-Critic-rjbs/lib/Perl/Critic/Policy/Miscellanea/RequireRcsKeywords.pm --- Perl-Critic-0.21/lib/Perl/Critic/Policy/Miscellanea/RequireRcsKeywords.pm 2006-11-05 21:07:52.000000000 -0500 +++ Perl-Critic-rjbs/lib/Perl/Critic/Policy/Miscellanea/RequireRcsKeywords.pm 2006-11-08 19:11:17.000000000 -0500 @@ -100,6 +100,7 @@ sub _wanted { my ( undef, $elem ) = @_; return $elem->isa('PPI::Token::Comment') + || $elem->isa('PPI::Token::Pod') || $elem->isa('PPI::Token::Quote::Single') || $elem->isa('PPI::Token::Quote::Literal'); } diff -Nur Perl-Critic-0.21/t/20_policies_miscellanea.t Perl-Critic-rjbs/t/20_policies_miscellanea.t --- Perl-Critic-0.21/t/20_policies_miscellanea.t 2006-11-05 21:07:51.000000000 -0500 +++ Perl-Critic-rjbs/t/20_policies_miscellanea.t 2006-11-08 19:10:50.000000000 -0500 @@ -9,7 +9,7 @@ use strict; use warnings; -use Test::More tests => 11; +use Test::More tests => 12; # common P::C testing tools use Perl::Critic::TestUtils qw(pcritique); @@ -33,6 +33,21 @@ #---------------------------------------------------------------- $code = <<'END_PERL'; +=pod + + $Revision: 809 $ + $Source$ + $Date: 2006-11-05 18:01:38 -0800 (Sun, 05 Nov 2006) $ + +=cut +END_PERL + +$policy = 'Miscellanea::RequireRcsKeywords'; +is( pcritique($policy, \$code), 0, $policy); + +#---------------------------------------------------------------- + +$code = <<'END_PERL'; # $Revision: 809 $ # $Source$ # $Date: 2006-11-05 18:01:38 -0800 (Sun, 05 Nov 2006) $
Fixed in the trunk, SVN revision 882.
This is fixed in Perl-Critic-0.22. Thanks for the patch. -Jeff