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

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

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



From balldarrens [...] gmail.com Tue May 11 14: 26:27 2010
MIME-Version: 1.0
X-Spam-Status: No, score=-9.912 tagged_above=-99.9 required=10 tests=[BAYES_00=-2.599, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_HI=-8, SPF_NEUTRAL=0.686] autolearn=ham
X-Spam-Flag: NO
X-Virus-Checked: Checked by ClamAV on 16.mx.develooper.com
Content-Type: multipart/alternative; boundary=0015174780a486e214048655aaa9
Message-ID: <AANLkTikXdM4Ty2CaI-Bzh-liboV3OMFD9GZrIM5RVft_ [...] mail.gmail.com>
X-Virus-Scanned: Debian amavisd-new at bestpractical.com
X-Spam-Score: -9.912
Received: from localhost (localhost [127.0.0.1]) by hipster.bestpractical.com (Postfix) with ESMTP id 965D62406E0 for <cpan-bug+Perl-Critic [...] hipster.bestpractical.com>; Tue, 11 May 2010 14:26:27 -0400 (EDT)
Received: from hipster.bestpractical.com ([127.0.0.1]) by localhost (hipster.bestpractical.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 1wSgpKxrxBnE for <cpan-bug+Perl-Critic [...] hipster.bestpractical.com>; Tue, 11 May 2010 14:26:25 -0400 (EDT)
Received: from la.mx.develooper.com (x1.develooper.com [207.171.7.70]) by hipster.bestpractical.com (Postfix) with SMTP id DC7E52406D9 for <bug-Perl-Critic [...] rt.cpan.org>; Tue, 11 May 2010 14:26:24 -0400 (EDT)
Received: (qmail 26183 invoked by uid 103); 11 May 2010 18:26:47 -0000
Received: from x16.dev (10.0.100.26) by x1.dev with QMQP; 11 May 2010 18:26:47 -0000
Received: from mail-fx0-f50.google.com (HELO mail-fx0-f50.google.com) (209.85.161.50) by 16.mx.develooper.com (qpsmtpd/0.80) with ESMTP; Tue, 11 May 2010 11:26:42 -0700
Received: by fxm1 with SMTP id 1so1096693fxm.9 for <bug-Perl-Critic [...] rt.cpan.org>; Tue, 11 May 2010 11:26:38 -0700 (PDT)
Received: by 10.204.146.148 with SMTP id h20mr2766930bkv.185.1273602398150; Tue, 11 May 2010 11:26:38 -0700 (PDT)
Received: by 10.204.56.142 with HTTP; Tue, 11 May 2010 11:26:18 -0700 (PDT)
Authentication-Results: hipster.bestpractical.com (amavisd-new); dkim=pass header.i= [...] gmail.com
Authentication-Results: hipster.bestpractical.com (amavisd-new); domainkeys=pass header.from=balldarrens [...] gmail.com
Delivered-To: cpan-bug+Perl-Critic [...] hipster.bestpractical.com
Subject: Using Module::Pluggable is problematic (needs to allow 'execpt' regex to avoid SCCS files when in source control context
Return-Path: <balldarrens [...] gmail.com>
Domainkey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:from:date:message-id:subject:to:content-type; b=M3mvvdShEFZlHfC6miPIqHE3VUI7y8hypRXcqy8nlpBnMdhGWHlxL5940vo9/sNEKe +QwHQ3DFyIID38fDk20blexBxKuQ7XnkBA6RlFoFfjrjeVGnhxfRRmfhib27jRf42XaC 683EVYNrRq18tOoOdI2ho606u0l/ssZqp5K70=
X-RT-Mail-Extension: perl-critic
X-Original-To: cpan-bug+Perl-Critic [...] hipster.bestpractical.com
X-Spam-Check-BY: 16.mx.develooper.com
Dkim-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:mime-version:received:from:date :message-id:subject:to:content-type; bh=tqHCo9zb2npBV5trgnO4c7QTdxNLFkGyLTw5Td/8VpM=; b=T9VnYleQyzPfj+qQYfiVFOxqpeYZnk3lP4oA9W8DYBECJzF37F0uErGSZaTRgl/R0F MG2vKDQDGoJdoJWLdqXx5Vzwu6/TUBw9Usb7Le1+Trt7smb/GyRv+ttQHABoyDh31eO3 3szJwkxXrSHdPDPX4/yQKO3PXqT7xEe/3TchA=
Date: Tue, 11 May 2010 14:26:18 -0400
X-Spam-Level:
To: bug-Perl-Critic [...] rt.cpan.org
From: Darren Ball <balldarrens [...] gmail.com>
Content-Length: 0
content-type: text/plain; charset="utf-8"
X-RT-Original-Encoding: ISO-8859-1
Content-Length: 4674
Download (untitled) / with headers
text/plain 4.5k
An example of the situation: Warning: Use of "CORE" without parentheses is ambiguous at (eval 62) line 1. Couldn't require Perl::Critic::Policy::BuiltinFunctions::SCCS::s.ProhibitBooleanGrep : Bareword "ProhibitBooleanGrep" not allowed while "strict subs" in use at (eval 62) line 1. at /opt/langs/ActivePerl-5.10.1/lib/Module/Pluggable.pm line 28 Warning: Use of "CORE" without parentheses is ambiguous at (eval 63) line 1. Couldn't require Perl::Critic::Policy::BuiltinFunctions::SCCS::s.ProhibitComplexMappings : Bareword "ProhibitComplexMappings" not allowed while "strict subs" in use at (eval 63) line 1. at /opt/langs/ActivePerl-5.10.1/lib/Module/Pluggable.pm line 28 Warning: Use of "CORE" without parentheses is ambiguous at (eval 64) line 1. Couldn't require Perl::Critic::Policy::BuiltinFunctions::SCCS::s.ProhibitLvalueSubstr : Bareword "ProhibitLvalueSubstr" not allowed while "strict subs" in use at (eval 64) line 1. at /opt/langs/ActivePerl-5.10.1/lib/Module/Pluggable.pm line 28 Warning: Use of "CORE" without parentheses is ambiguous at (eval 65) line 1. ... In Perl::Critic::PolicyFactory, you are using Module::Pluggable, and the namespace search path that you are providing seems to be scanning all directory structures, even source control directories. This needs to be adjusted so that an exclusion regex can be 'passed' to the import (not sure why this is in import) method. The old code looks like: sub import { my ( $class, %args ) = @_; my $test_mode = $args{-test}; my $extra_test_policies = $args{'-extra-test-policies'}; if ( not @site_policy_names ) { my $eval_worked = eval { require Module::Pluggable; print $POLICY_NAMESPACE; Module::Pluggable->import(search_path => $POLICY_NAMESPACE, require => 1, inner => 0); @site_policy_names = plugins(); #Exported by Module::Pluggable 1; }; if (not $eval_worked) { if ( $EVAL_ERROR ) { throw_generic qq<Can't load Policies from namespace "$POLICY_NAMESPACE": $EVAL_ERROR>; } throw_generic qq<Can't load Policies from namespace "$POLICY_NAMESPACE" for an unknown reason.>; } if ( not @site_policy_names ) { throw_generic qq<No Policies found in namespace "$POLICY_NAMESPACE".>; } } # In test mode, only load native policies, not third-party ones if ( $test_mode && any {m/\b blib \b/xms} @INC ) { @site_policy_names = _modules_from_blib( @site_policy_names ); if ($extra_test_policies) { my @extra_policy_full_names = map { "${POLICY_NAMESPACE}::$_" } @{$extra_test_policies}; push @site_policy_names, @extra_policy_full_names; } } return 1; } New code that is working to avoid errors above (excluding SCCS directories using the 'except' parameter for Module::Pluggable): sub import { my ( $class, %args ) = @_; my $test_mode = $args{-test}; my $extra_test_policies = $args{'-extra-test-policies'}; if ( not @site_policy_names ) { my $eval_worked = eval { require Module::Pluggable; print $POLICY_NAMESPACE; Module::Pluggable->import(search_path => $POLICY_NAMESPACE, require => 1, inner => 0, except => qr /::SCCS::/); @site_policy_names = plugins(); #Exported by Module::Pluggable 1; }; if (not $eval_worked) { if ( $EVAL_ERROR ) { throw_generic qq<Can't load Policies from namespace "$POLICY_NAMESPACE": $EVAL_ERROR>; } throw_generic qq<Can't load Policies from namespace "$POLICY_NAMESPACE" for an unknown reason.>; } if ( not @site_policy_names ) { throw_generic qq<No Policies found in namespace "$POLICY_NAMESPACE".>; } } # In test mode, only load native policies, not third-party ones if ( $test_mode && any {m/\b blib \b/xms} @INC ) { @site_policy_names = _modules_from_blib( @site_policy_names ); if ($extra_test_policies) { my @extra_policy_full_names = map { "${POLICY_NAMESPACE}::$_" } @{$extra_test_policies}; push @site_policy_names, @extra_policy_full_names; } } return 1; } There should be a way to pass through any argument that is potentially usable for Module::Pluggable to this factory.
content-type: text/html; charset="utf-8"
Content-Transfer-Encoding: quoted-printable
X-RT-Original-Encoding: ISO-8859-1
Content-Length: 6849


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.