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

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

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



Subject: 5.14 re pragma and PCP::RegularExpressions::RequireDotMatchAnything, ::RequireExtendedFormatting, ::RequireLineBoundaryMatching
The perl 5.14 "use re" pragma now lets you set default flags for regular expressions per lexical scope. The following policies should not report violations when the appropriate flags are applied in this manner. RegularExpressions::RequireDotMatchAnything, RegularExpressions::RequireExtendedFormatting RegularExpressions::RequireLineBoundaryMatching For bonus points, also honor the Regexp::DefaultFlags module which is namespace- rather than scope-based.
On Thu Nov 03 16:15:25 2011, MJGARDNER wrote: Show quoted text
> The perl 5.14 "use re" pragma now lets you set default flags for regular > expressions per lexical scope.
Someone’s using that? :-) Show quoted text
> The following policies should not report > violations when the appropriate flags are applied in this manner. > > RegularExpressions::RequireDotMatchAnything, > RegularExpressions::RequireExtendedFormatting > RegularExpressions::RequireLineBoundaryMatching > > For bonus points, also honor the Regexp::DefaultFlags module which is > namespace- rather than scope-based.
Subject: Re: [rt.cpan.org #72151] 5.14 re pragma and PCP::RegularExpressions::RequireDotMatchAnything, ::RequireExtendedFormatting, ::RequireLineBoundaryMatching
Date: Fri, 4 Nov 2011 16:03:03 -0400
To: bug-Perl-Critic [...] rt.cpan.org
From: Mark Gardner <mjgardner [...] cpan.org>
On Fri, Nov 4, 2011 at 12:38 PM, Father Chrysostomos via RT <bug-Perl-Critic@rt.cpan.org> wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=72151 > > > On Thu Nov 03 16:15:25 2011, MJGARDNER wrote:
>> The perl 5.14 "use re" pragma now lets you set default flags for regular >> expressions per lexical scope.
> > Someone’s using that? :-)
For anything where I can use 5.014, I do "use re '/xms'". For all else I do "use Regexp::DefaultFlags". Both address the cited policies.
On Fri Nov 04 16:03:33 2011, MJGARDNER wrote: Show quoted text
> On Fri, Nov 4, 2011 at 12:38 PM, Father Chrysostomos via RT > <bug-Perl-Critic@rt.cpan.org> wrote:
> > <URL: https://rt.cpan.org/Ticket/Display.html?id=72151 > > > > > On Thu Nov 03 16:15:25 2011, MJGARDNER wrote:
> >> The perl 5.14 "use re" pragma now lets you set default flags for
regular Show quoted text
> >> expressions per lexical scope.
> > > > Someone’s using that? :-)
> > For anything where I can use 5.014, I do "use re '/xms'". For all > else I do "use Regexp::DefaultFlags". Both address the cited > policies.
This is really two issues: 1) The 'use re qw{ /modifiers };' functionality appears to require support from PPIx::Regexp which is not currently there. For that reason, I'm marking this 'stalled' until PPIx::Regexp gets sorted out. 2) Regexp::DefaultFlags is another thing altogether, not only because its scoping rules are different. The team has historically been parsimonious in its support of non-core modules that change core semantics, because once you start that sort of thing, where do you stop? Tom
RT https://rt.cpan.org/Ticket/Display.html?id=72469 is to track the PPIx::Regexp part of the work. I have outlined there my current plans for implementation and what I have done so far.
On Wed Nov 16 17:25:52 2011, WYANT wrote: Show quoted text
> RT https://rt.cpan.org/Ticket/Display.html?id=72469 is to track the > PPIx::Regexp part of the work. I have outlined there my current plans > for implementation and what I have done so far.
PPIx-Regexp 0.022 went to CPAN yesterday (24-Nov-2011 23:45 UT). This has the fixes I intend to make to support Perl::Critic. I intend to commit the Perl::Critic changes in a day or two, once the PPIx::Regexp changes have a chance to flush through the system.
On Fri Nov 25 12:15:47 2011, WYANT wrote: Show quoted text
> On Wed Nov 16 17:25:52 2011, WYANT wrote:
> > RT https://rt.cpan.org/Ticket/Display.html?id=72469 is to track the > > PPIx::Regexp part of the work. I have outlined there my current plans > > for implementation and what I have done so far.
> > PPIx-Regexp 0.022 went to CPAN yesterday (24-Nov-2011 23:45 UT). This > has the fixes I intend to make to support Perl::Critic. I intend to > commit the Perl::Critic changes in a day or two, once the PPIx::Regexp > changes have a chance to flush through the system.
The changes to support 'use re /modifiers' have been committed as SVN revision 4095. This requires PPIx::Regexp 0.022. The 'extra credit (support of Regexp::DefaultFlags) is not in this commit.
This has been fixed and released as Perl-Critic-1.117 (but without the "extra credit"). -- Jeffrey Thalhammer Imaginative Software Systems www.imaginative-software.com