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

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

Bug Information
Severity: Important
Broken in: 0.2
Fixed in: (no value)



Subject: RequirePodSections still runs after global ## no critic
Even though I have ## no critic at the top of my pm file, it still gripes about RequirePodSections. I have a custom RequirePodSections section in my rc file. --test output--- # Perl::Critic found these violations in "blib\lib\Handel\L10N\en_us.pm": # Missing "SYNOPSIS" section in POD at line 1, column 1: Documentation::RequirePodSections Severity 2 # # $Id: en_us.pm 1335 2006-07-15 02:43:12Z claco $ # Missing "DESCRIPTION" section in POD at line 1, column 1: Documentation::RequirePodSections Severity 2 # # $Id: en_us.pm 1335 2006-07-15 02:43:12Z claco $ Show quoted text
---rc file--- [Documentation::RequirePodSections] lib_sections = NAME | SYNOPSIS | DESCRIPTION | AUTHOR
---module--- # $Id: en_us.pm 1335 2006-07-15 02:43:12Z claco $ ## no critic package Handel::L10N::en_us; use strict; use warnings; use utf8; use vars qw/%Lexicon/; BEGIN { use base qw/Handel::L10N/; }; %Lexicon = ( Language => 'English', ); 1; __END__ =head1 NAME Handel::L10N::en_us - Handel Language Pack: US English =head1 AUTHOR Christopher H. Laco CPAN ID: CLACO claco@chrislaco.com http://today.icantfocus.com/blog/
Subject: Re: [rt.cpan.org #21506] RequirePodSections still runs after global ## no critic
Date: Thu, 14 Sep 2006 21:32:55 -0500
To: bug-Perl-Critic [...] rt.cpan.org
From: Chris Dolan <chris [...] clotho.com>
Two comments: 1) Your "## no critic" isn't actually at the top of the code as you described it. It's on the second line. Note that the errors are noted at line 1 of the file, which is before the "## no critic". 2) For all-document policies like this one In this case, it's probably be easier to just disable the policy in a perlcriticrc file. Chris
CC: CLACO [...] cpan.org
Subject: Re: [rt.cpan.org #21506] RequirePodSections still runs after global ## no critic
Date: Thu, 14 Sep 2006 22:46:01 -0400
To: bug-Perl-Critic [...] rt.cpan.org
From: "Christopher H. Laco" <claco [...] chrislaco.com>
chris@clotho.com via RT wrote: Show quoted text
> <URL: http://rt.cpan.org/Ticket/Display.html?id=21506 > > > Two comments: > > 1) Your "## no critic" isn't actually at the top of the code as you > described it. It's on the second line. Note that the errors are > noted at line 1 of the file, which is before the "## no critic".
While I agree overall, I have 6 other modules out of 20 or so that have ## no critic on line 2, below $Id$, and they all work just fine. It's just these 4 L10N modules that won't cooperate. If I move it to line one in these modules, it indeed works. That fact that line works on line 2 in some modules, and not in others still means something is amiss. Show quoted text
> > 2) For all-document policies like this one In this case, it's > probably be easier to just disable the policy in a perlcriticrc file. > > Chris
While would I disable the policy entirely in the rc? I certinaly want all of my modules except for these bare bones ones to follow the spec. OR did I miss the point of the suggestion? -=Chris
Download signature.asc
application/pgp-signature 189b

Message body not shown because it is not plain text.

Subject: Re: [rt.cpan.org #21506] RequirePodSections still runs after global ## no critic
Date: Fri, 15 Sep 2006 20:24:02 -0500
To: bug-Perl-Critic [...] rt.cpan.org
From: Chris Dolan <chris [...] clotho.com>
On Sep 14, 2006, at 9:46 PM, claco@chrislaco.com via RT wrote: Show quoted text
>> 1) Your "## no critic" isn't actually at the top of the code as you >> described it. It's on the second line. Note that the errors are >> noted at line 1 of the file, which is before the "## no critic".
> > While I agree overall, I have 6 other modules out of 20 or so that > have > ## no critic on line 2, below $Id$, and they all work just fine. > > It's just these 4 L10N modules that won't cooperate. If I move it to > line one in these modules, it indeed works. > > That fact that line works on line 2 in some modules, and not in others > still means something is amiss.
I see. That's odd. The L10N ones are working as expected, and it's the other ones that are behaving unexpectedly. Can you share some code that shows "## no critic" on line 2 where it doesn't trigger the policy? Show quoted text
>> 2) For all-document policies like this one In this case, it's >> probably be easier to just disable the policy in a perlcriticrc file.
> > > While would I disable the policy entirely in the rc? I certinaly want > all of my modules except for these bare bones ones to follow the spec. > OR did I miss the point of the suggestion?
No, it was just me misunderstanding you. I didn't realize you had other modules involved, and I mistook you for a novice user. :-) Chris
CC: CLACO [...] cpan.org
Subject: Re: [rt.cpan.org #21506] RequirePodSections still runs after global ## no critic
Date: Fri, 15 Sep 2006 21:30:07 -0400
To: bug-Perl-Critic [...] rt.cpan.org
From: "Christopher H. Laco" <claco [...] chrislaco.com>
chris@clotho.com via RT wrote: Show quoted text
> <URL: http://rt.cpan.org/Ticket/Display.html?id=21506 > > > On Sep 14, 2006, at 9:46 PM, claco@chrislaco.com via RT wrote: >
>>> 1) Your "## no critic" isn't actually at the top of the code as you >>> described it. It's on the second line. Note that the errors are >>> noted at line 1 of the file, which is before the "## no critic".
>> While I agree overall, I have 6 other modules out of 20 or so that >> have >> ## no critic on line 2, below $Id$, and they all work just fine. >> >> It's just these 4 L10N modules that won't cooperate. If I move it to >> line one in these modules, it indeed works. >> >> That fact that line works on line 2 in some modules, and not in others >> still means something is amiss.
> > I see. That's odd. The L10N ones are working as expected, and it's > the other ones that are behaving unexpectedly. Can you share some > code that shows "## no critic" on line 2 where it doesn't trigger the > policy?
Easy peasy: nc at the top. put on on line two, and it doesn't work: http://svn.handelframework.com/CPAN/Handel/branches/DBIC-1.0/lib/Handel/L10N/en_us.pm nc on line 2 and it works. remove it, and we get lots of critics: http://svn.handelframework.com/CPAN/Handel/branches/DBIC-1.0/lib/AxKit/XSP/Handel/Cart.pm my rc: http://svn.handelframework.com/CPAN/Handel/branches/DBIC-1.0/t/style_perl_critic.rc my test script: http://svn.handelframework.com/CPAN/Handel/branches/DBIC-1.0/t/style_perl_critic.t PPI 1.117, Perl::Critic: 0.2 Show quoted text
> >
>>> 2) For all-document policies like this one In this case, it's >>> probably be easier to just disable the policy in a perlcriticrc file.
>> >> While would I disable the policy entirely in the rc? I certinaly want >> all of my modules except for these bare bones ones to follow the spec. >> OR did I miss the point of the suggestion?
> > No, it was just me misunderstanding you. I didn't realize you had > other modules involved, and I mistook you for a novice user. :-)
You give me too much credit. Some days, I swear I am. :-) -=Chris
Download signature.asc
application/pgp-signature 189b

Message body not shown because it is not plain text.

Subject: Re: [rt.cpan.org #21506] RequirePodSections still runs after global ## no critic
Date: Fri, 15 Sep 2006 20:51:32 -0500
To: bug-Perl-Critic [...] rt.cpan.org
From: Chris Dolan <chris [...] clotho.com>
On Sep 15, 2006, at 8:30 PM, claco@chrislaco.com via RT wrote: Show quoted text
> nc at the top. put on on line two, and it doesn't work: > http://svn.handelframework.com/CPAN/Handel/branches/DBIC-1.0/lib/ > Handel/L10N/en_us.pm > > nc on line 2 and it works. remove it, and we get lots of critics: > http://svn.handelframework.com/CPAN/Handel/branches/DBIC-1.0/lib/ > AxKit/XSP/Handel/Cart.pm
That one "works" because there are no policy violations on Line 1. You have a "DESCRIPTION" and a "SYNOPSIS", so the "Documentation::RequirePodSections" policy passes successfully. I have a different .perltidyrc than you, so I see: % perlcritic -1 -profile t/style_perl_critic.rc lib/AxKit/XSP/ Handel/Cart.pm ## Please see file perltidy.ERR Code is not tidy at line 1, column 1. See page 33 of PBP. (Severity: 1) So, it looks like the "works on line 2" theory was a red herring and I believe the Documentation::RequirePodSections policy is working as advertised. However, I do believe that the "line 1" policies should probably be better documented to explain that to block them, you really do need a "## no critic" on line 1. So, I thank you for exposing that flaw. Chris
CC: CLACO [...] cpan.org
Subject: Re: [rt.cpan.org #21506] RequirePodSections still runs after global ## no critic
Date: Fri, 15 Sep 2006 21:57:33 -0400
To: bug-Perl-Critic [...] rt.cpan.org
From: "Christopher H. Laco" <claco [...] chrislaco.com>
chris@clotho.com via RT wrote: Show quoted text
> <URL: http://rt.cpan.org/Ticket/Display.html?id=21506 > > > On Sep 15, 2006, at 8:30 PM, claco@chrislaco.com via RT wrote: >
>> nc at the top. put on on line two, and it doesn't work: >> http://svn.handelframework.com/CPAN/Handel/branches/DBIC-1.0/lib/ >> Handel/L10N/en_us.pm >> >> nc on line 2 and it works. remove it, and we get lots of critics: >> http://svn.handelframework.com/CPAN/Handel/branches/DBIC-1.0/lib/ >> AxKit/XSP/Handel/Cart.pm
> > That one "works" because there are no policy violations on Line 1. > You have a "DESCRIPTION" and a "SYNOPSIS", so the > "Documentation::RequirePodSections" policy passes successfully. I > have a different .perltidyrc than you, so I see: > > % perlcritic -1 -profile t/style_perl_critic.rc lib/AxKit/XSP/ > Handel/Cart.pm > ## Please see file perltidy.ERR > Code is not tidy at line 1, column 1. See page 33 of PBP. > (Severity: 1) > > So, it looks like the "works on line 2" theory was a red herring and > I believe the Documentation::RequirePodSections policy is working as > advertised.
Oddly enough, I see your output mentioned Perl::Tidy, which I don't have installed. I wonder if that's the something that's causing something to go awry. Show quoted text
> > However, I do believe that the "line 1" policies should probably be > better documented to explain that to block them, you really do need a > "## no critic" on line 1. So, I thank you for exposing that flaw. > > Chris
Leave it to me to be the oddball. :-) -=Chris
Download signature.asc
application/pgp-signature 189b

Message body not shown because it is not plain text.

Subject: Re: [rt.cpan.org #21506] RequirePodSections still runs after global ## no critic
Date: Fri, 15 Sep 2006 21:56:23 -0500
To: bug-Perl-Critic [...] rt.cpan.org
From: Chris Dolan <chris [...] clotho.com>
On Sep 15, 2006, at 8:57 PM, claco@chrislaco.com via RT wrote: Show quoted text
> Oddly enough, I see your output mentioned Perl::Tidy, which I don't > have > installed. I wonder if that's the something that's causing > something to > go awry.
That comes from CodeLayout::RequireTidyCode which starts with something like: ... eval {require Perl::Tidy;}; return if ($@); # return violation if code is not tidy ... Thus, if the optional Perl::Tidy module is missing, that policy passes automatically. I brought it up simply because, like RequirePodSections, it applies to the whole document and thus registers any violations on line 1. Chris
Like Chris said, these policies probably need better documentation, but this isn't a bug, per-se. So I'm going to mark this as "stalled" for now.