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

People
Owner: Nobody in particular
Requestors: ryandjohnson [...] gmail.com
Cc:
AdminCc:

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



Subject: Perl::Critic 1.082 with perl 5.10: RequireNoMatchVarsWithUseEnglish false positives
Date: Wed, 19 Mar 2008 13:15:03 -0700
To: bug-Perl-Critic [...] rt.cpan.org
From: Ryan D Johnson <ryandjohnson [...] gmail.com>
I tried to figure out how to reproduce this with the tests in the distro, but I'm afraid I had trouble understanding how they worked and which ones were or weren't running. In any case, I couldn't get them to fail. Please let me know what I can do to help troubleshoot. Here's at least a shell transcript showing a failure: $ perlcritic -profile .PerlySenseProject/.perlcritic t/05jslint.t "use English" without '-no_match_vars' argument at line 9, column 1. "use English" without the '-no_match_vars' argument degrades performance.'. (Severity: 2) $ grep English t/05jslint.t use English '-no-match-vars'; $ perl -MPerl::Critic\ 9999 Perl::Critic version 9999 required--this is only version 1.082. BEGIN failed--compilation aborted. $ perl -V Summary of my perl5 (revision 5 version 10 subversion 0) configuration: Platform: osname=linux, osvers=2.6.22-14-generic, archname=i686-linux uname='linux host 2.6.22-14-generic #1 smp tue feb 12 07:42:25 utc 2008 i686 gnulinux ' config_args='-des -Dprefix=/home/ryan/localperl' hint=recommended, useposix=true, d_sigaction=define useithreads=undef, usemultiplicity=undef useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef use64bitint=undef, use64bitall=undef, uselongdouble=undef usemymalloc=n, bincompat5005=undef Compiler: cc='cc', ccflags ='-fno-strict-aliasing -pipe -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64', optimize='-O2', cppflags='-fno-strict-aliasing -pipe -I/usr/local/include' ccversion='', gccversion='4.1.3 20070929 (prerelease) (Ubuntu 4.1.2-16ubuntu2)', gccosandvers='' intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234 d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12 ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8 alignbytes=4, prototype=define Linker and Libraries: ld='cc', ldflags =' -L/usr/local/lib' libpth=/usr/local/lib /lib /usr/lib /usr/lib64 libs=-lnsl -ldl -lm -lcrypt -lutil -lc perllibs=-lnsl -ldl -lm -lcrypt -lutil -lc libc=/lib/libc-2.6.1.so, so=so, useshrplib=false, libperl=libperl.a gnulibc_version='2.6.1' Dynamic Linking: dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E' cccdlflags='-fPIC', lddlflags='-shared -O2 -L/usr/local/lib' Characteristics of this binary (from libperl): Compile-time options: PERL_DONT_CREATE_GVSV PERL_MALLOC_WRAP USE_LARGE_FILES USE_PERLIO Built under linux Compiled at Mar 12 2008 01:41:42 @INC: /home/ryan/localperl/lib/5.10.0/i686-linux /home/ryan/localperl/lib/5.10.0 /home/ryan/localperl/lib/site_perl/5.10.0/i686-linux /home/ryan/localperl/lib/site_perl/5.10.0 $ which perlcritic /home/ryan/localperl/bin/perlcritic
Subject: Re: [rt.cpan.org #34258] Perl::Critic 1.082 with perl 5.10: RequireNoMatchVarsWithUseEnglish false positives
Date: Wed, 19 Mar 2008 16:28:21 -0500
To: bug-Perl-Critic [...] rt.cpan.org
From: Elliot Shank <perl [...] galumph.com>
Ryan D Johnson via RT wrote: Show quoted text
> I tried to figure out how to reproduce this with the tests in the > distro, but I'm afraid I had trouble understanding how they worked and > which ones were or weren't running. In any case, I couldn't get them to > fail. > > Please let me know what I can do to help troubleshoot. > > Here's at least a shell transcript showing a failure: > > $ perlcritic -profile .PerlySenseProject/.perlcritic t/05jslint.t > "use English" without '-no_match_vars' argument at line 9, column 1. "use English" without the '-no_match_vars' argument degrades performance.'. (Severity: 2) > > $ grep English t/05jslint.t > use English '-no-match-vars';
Interesting. There's a test for this specific case. (t/Modules/RequireUseNoMatchVarsWithUseEnglish.run test #2) Would you mind sending a copy of your file?
Subject: Re: [rt.cpan.org #34258] Perl::Critic 1.082 with perl 5.10: RequireNoMatchVarsWithUseEnglish false positives
Date: Wed, 19 Mar 2008 14:59:49 -0700
To: bug-Perl-Critic [...] rt.cpan.org
From: Ryan D Johnson <ryandjohnson [...] gmail.com>
"Elliot Shank via RT" <bug-Perl-Critic@rt.cpan.org> writes: Show quoted text
> Interesting. There's a test for this specific case. > (t/Modules/RequireUseNoMatchVarsWithUseEnglish.run test #2)
Yeah, I found that .run file, but I wasn't really sure how to, um, run it, nor which .t file might be a driver for the many .run files. Show quoted text
> Would you mind sending a copy of your file?
Well, it's really easy to reproduce even without a specific file: $ cat > english.pl #!/usr/bin/env perl use English '-no-match-vars'; $ perlcritic -1 english.pl RCS keywords $Id$ not found at line 1, column 1. See page 441 of PBP. (Severity: 2) RCS keywords $Revision$, $HeadURL$, $Date$ not found at line 1, column 1. See page 441 of PBP. (Severity: 2) RCS keywords $Revision$, $Source$, $Date$ not found at line 1, column 1. See page 441 of PBP. (Severity: 2) No "VERSION" variable found at line 1, column 1. See page 404 of PBP. (Severity: 2) "use English" without '-no_match_vars' argument at line 3, column 1. "use English" without the '-no_match_vars' argument degrades performance.'. (Severity: 2) /rdj
Subject: Re: [rt.cpan.org #34258] Perl::Critic 1.082 with perl 5.10: RequireNoMatchVarsWithUseEnglish false positives
Date: Wed, 19 Mar 2008 17:59:19 -0500
To: bug-Perl-Critic [...] rt.cpan.org
From: Elliot Shank <perl [...] galumph.com>
Ryan D Johnson via RT wrote: Show quoted text
>> Interesting. There's a test for this specific case. >> (t/Modules/RequireUseNoMatchVarsWithUseEnglish.run test #2)
> > Yeah, I found that .run file, but I wasn't really sure how to, um, run > it, nor which .t file might be a driver for the many .run files.
perl t/20_policies.t Modules::RequireNoMatchVarsWithUseEnglish or perl t/20_policies.t t/Modules/RequireNoMatchVarsWithUseEnglish.run Also, look at http://search.cpan.org/dist/Perl-Critic/lib/Perl/Critic/TestUtils.pm#.run_file_information Show quoted text
>> Would you mind sending a copy of your file?
> > Well, it's really easy to reproduce even without a specific file: > > $ cat > english.pl > #!/usr/bin/env perl > > use English '-no-match-vars'; > > $ perlcritic -1 english.pl
Confirmed. I don't have time to look at it in detail at the second, but it should just be something stupid. The output of tools/ppidump (included in the distro but not installed) looks sane. BTW, rather than getting everything by using -1 you can get only the policy you want with --single-policy: perlcritic --single-policy English english.pl
Subject: Re: [rt.cpan.org #34258] Perl::Critic 1.082 with perl 5.10: RequireNoMatchVarsWithUseEnglish false positives
Date: Wed, 19 Mar 2008 17:49:18 -0700 (PDT)
To: bug-Perl-Critic [...] rt.cpan.org
From: Jeffrey Thalhammer <jeffrey.thalhammer [...] yahoo.com>
Hold on... '-no-match-vars' ne '-no_match_vars'; Might that be the problem? -Jeff
Subject: Re: [rt.cpan.org #34258] Perl::Critic 1.082 with perl 5.10: RequireNoMatchVarsWithUseEnglish false positives
Date: Wed, 19 Mar 2008 17:59:52 -0700
To: bug-Perl-Critic [...] rt.cpan.org
From: Ryan D Johnson <ryandjohnson [...] gmail.com>
"Elliot Shank via RT" <bug-Perl-Critic@rt.cpan.org> writes: Show quoted text
>> Well, it's really easy to reproduce even without a specific file: >> >> $ cat > english.pl >> #!/usr/bin/env perl >> >> use English '-no-match-vars';
Wow, Elliot, what a monumental waste of your time (but not a waste of mine!). I have been doing this wrong apparently forever. Obviously, it's supposed to be -no_match_vars, with underscores, not with hyphens. It's not that it's passing in perl 5.8.8, it's that this is a *new* policy in 1.082, and I haven't upgraded it yet on my perl 5.8.8 install. What a great new policy! You don't want to know how long I messed with it before I realized the trouble. is_utf8 was employed, etc. Sorry for wasting your time. /rdj
Subject: Re: [rt.cpan.org #34258] Perl::Critic 1.082 with perl 5.10: RequireNoMatchVarsWithUseEnglish false positives
Date: Wed, 19 Mar 2008 20:12:49 -0500
To: bug-Perl-Critic [...] rt.cpan.org
From: Elliot Shank <perl [...] galumph.com>
Jeffrey Thalhammer via RT wrote: Show quoted text
> Queue: Perl-Critic > Ticket <URL: http://rt.cpan.org/Ticket/Display.html?id=34258 > > > Hold on... > > '-no-match-vars' ne '-no_match_vars'; > > Might that be the problem?
Oops. I'm a space cadet. Not paying attention. This is precisely why I wrote this one. There's no warning when you get it wrong.
Subject: Re: [rt.cpan.org #34258] Perl::Critic 1.082 with perl 5.10: RequireNoMatchVarsWithUseEnglish false positives
Date: Wed, 19 Mar 2008 18:27:50 -0700
To: bug-Perl-Critic [...] rt.cpan.org
From: Ryan D Johnson <ryandjohnson [...] gmail.com>
"Elliot Shank via RT" <bug-Perl-Critic@rt.cpan.org> writes: Show quoted text
> Jeffrey Thalhammer via RT wrote:
>> >> Hold on... >> >> '-no-match-vars' ne '-no_match_vars'; >> >> Might that be the problem?
> > Oops. I'm a space cadet. Not paying attention. > > This is precisely why I wrote this one. There's no warning when you > get it wrong.
If nothing else, I hope I have helped prove this policy a useful one. I would have never guessed that English just eats unrecognized import arguments. Thanks again. /rdj