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

People
Owner: thaljef [...] cpan.org
Requestors: steve.kirkup [...] dss.virginia.gov
Cc:
AdminCc:

Bug Information
Severity: Unimportant
Broken in: 0.14_02
Fixed in: 0.15_01



Subject: Bad Document Example
The following sample documentation is wrong, --begin below here-- A simple configuration might look like this: #-------------------------------------------------------------- # I think these are really important, so always load them [TestingAndDebugging::RequireUseStrict] severity = 5 [TestingAndDebugging::RequireUseWarnings] severity = 5 #-------------------------------------------------------------- # I think these are less important, so only load when asked [Variables::ProhibitPackageVars] severity = 2 [ControlStructures::ProhibitPostfixControls] allow = if unless #My custom configuration severity = 2 #-------------------------------------------------------------- # I do not agree with these at all, so never load them [-NamingConventions::ProhibitMixedCaseVars] [-NamingConventions::ProhibitMixedCaseSubs] #-------------------------------------------------------------- # For all other Policies, I accept the default severity, # so no additional configuration is required for them. --end here-- The problem is that you need to include 'Perl::Critic::Policy' in all of the header areas in the examples. Otherwise the Critic just skips over the section and does not complain. It was irrating for a while because I was trying to turn off some policies and using samples above just was not working. Once I added the 'Perl::Critic::Policy' it worked. The documentation lead me astray.
From: thaljef [...] cpan.org
Hi Steve- Thanks for reporting this. I'll get back to you as soon as I verify the problem. This one is a bit peculiar because in an earlier release, we had the exact opposite problem (i.e. prepending "Perl::Critic::Policy" would cause it to fail). I think we have test cases that work both ways, so I must have missed something. Just to be sure, would you mind sending me a copy of your .perlcriticrc file? Thanks. -Jeff
From: thaljef [...] cpan.org
I cut-and-paste the fromt the example configuration in the documentation, but I have not been able to reproduce the problem you described with version 0.14_02. If it existed in an earlier version, I'm a bit surprised that no one else reported it. Can you verify which version of Perl::Critic you have (`perlcritic -V` should do the trick) and send me a copy of the .perlcriticrc file that was caused the problem (in its broken form) and any command-line arguments you were using? If possible, could you also send a copy of the code you were analysing (just in case something else is happening here). Thanks. -Jeff
Subject: RE: [rt.cpan.org #18297] Bad Document Example
Date: Thu, 23 Mar 2006 08:19:44 -0500
To: <bug-Perl-Critic [...] rt.cpan.org>
From: "Steve Kirkup" <steve.kirkup [...] dss.virginia.gov>
Jeff, The text of my file was perlcriticrc file was used by Test::Perl::Critic and the problematic file looked like this, --begin after this line-- # Not interested in RCS control variables [-Miscellanea::RequireRcsKeywords] --end after this line--- Another thing about Test::Perl::Critic, was that it defaults to the highest severity rating when evaluating your code. This was why I was turning off the RCS keywords. I also saw that someone had reported a bug with RequireTidyCode and I was having problems with it as well. Now that I think about it though, I have been using Class::Std for inside out objects. A variable declaration would look like this, %foo :ATTR( :get<foo> :set<foo> ); After running through perltidy it breaks the code and it looks like this, %foo : ATTR ( :get <foo> : set <foo> ); I have to FIX my code to get to work again, so I wonder if that is why the tidy test fails... I am going to report that bug to Perl::Tidy at least. Steve Kirkup Show quoted text
-----Original Message----- From: Guest via RT [mailto:bug-Perl-Critic@rt.cpan.org] Sent: Wednesday, March 22, 2006 8:30 PM To: steve.kirkup@dss.virginia.gov Subject: [rt.cpan.org #18297] Bad Document Example <URL: http://rt.cpan.org/Ticket/Display.html?id=18297 > Hi Steve- Thanks for reporting this. I'll get back to you as soon as I verify the problem. This one is a bit peculiar because in an earlier release, we had the exact opposite problem (i.e. prepending "Perl::Critic::Policy" would cause it to fail). I think we have test cases that work both ways, so I must have missed something. Just to be sure, would you mind sending me a copy of your .perlcriticrc file? Thanks. -Jeff
Subject: RE: [rt.cpan.org #18297] Bad Document Example
Date: Thu, 23 Mar 2006 08:39:14 -0500
To: <bug-Perl-Critic [...] rt.cpan.org>
From: "Steve Kirkup" <steve.kirkup [...] dss.virginia.gov>
Jeff, Going back and running it again it worked correctly. It appears that I made some sort of typo using RequireRCSKeywords instead of RequireRcsKeywords. I feel foolish now... :( Could I request a change from you then, can you display a warning message for invalid policy tags? If it told me right away of a problem with the config file then I could see where the problem was right away. If performance was an issue how about adding a debug profile switch. Be default you can set to false, if it is true then it report problems with the profile. Thanks, Steve Kirkup Show quoted text
-----Original Message----- From: Jeffrey Thalhammer via RT [mailto:bug-Perl-Critic@rt.cpan.org] Sent: Wednesday, March 22, 2006 10:58 PM To: steve.kirkup@dss.virginia.gov Subject: [rt.cpan.org #18297] Bad Document Example <URL: http://rt.cpan.org/Ticket/Display.html?id=18297 > I cut-and-paste the fromt the example configuration in the documentation, but I have not been able to reproduce the problem you described with version 0.14_02. If it existed in an earlier version, I'm a bit surprised that no one else reported it. Can you verify which version of Perl::Critic you have (`perlcritic -V` should do the trick) and send me a copy of the .perlcriticrc file that was caused the problem (in its broken form) and any command-line arguments you were using? If possible, could you also send a copy of the code you were analysing (just in case something else is happening here). Thanks. -Jeff
Subject: RE: [rt.cpan.org #18297] Bad Document Example
Date: Thu, 23 Mar 2006 09:02:22 -0500
To: <bug-Perl-Critic [...] rt.cpan.org>
From: "Steve Kirkup" <steve.kirkup [...] dss.virginia.gov>
Jeff, I did come across one more problem that I would like you take a look at, This pieces of code comes back with, 'List declaration without trailing comma' $median = ( $times[ int $array_size / 2 ] + $times[(int $array_size / 2) - 1 ]) / 2; and this as well( I removed the inside (). $median = ( $times[ int $array_size / 2 ] + $times[ int $array_size / 2 - 1 ]) / 2; It appears that when I am using () in a mathematical express it views it a list instead. Steve Kirkup
Show quoted text
> Could I request a change from you then, can you display a warning > message for invalid policy tags? If it told me right away of a > problem with the config file then I could see where the problem was > right away.
That's a great idea. I'll get that into the release this weekend. Thanks for the suggestion. -Jeff
Show quoted text
> It appears that when I am using () in a mathematical express it > views it a list instead.
Yep. PPI doesn't distinguish between list parens and mathematical ones. I thought I had fixed this in an earlier version, but I'll double check later tonight.