Skip Menu |

This queue is for tickets about the Module-ScanDeps CPAN distribution.

Report information
The Basics
Id: 6611
Status: resolved
Priority: 0/
Queue: Module-ScanDeps

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

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



Subject: The 'chunk' concept for things like 'use base' is totally wrong
Went to try to add Class::Autouse support for Module::Scandeps and discovered it uses a "chunk" concept, where a chunk is split /;/ within a single line. Which is useless to me, since I have tons of use Class::Autouse 'CGI', 'Class::Inspector', 'File::Find::Rule', etc, etc; SO! Scanning for things like use base and use Class::Autouse etc need to be broken out into a seperate scan area. The best method to use would be something like the following untested code. $_ = $all_file_content; while ( m/(?<=\n)\s*use\s+base\b\s*(.+?)\;/m ) { free_from_evil( $1 ) or die "WTF is this... '$1'"; eval "@classes = ($1)"; add_classes( @classes ); } you get the idea. I'd probably wrap the whole '(newline)(pattern)(arguments across multiple lines)' concept up into a single function of something. Anyways, if you can add the basic infrastructure ( and maybe drop some comments in while you are there ) I can do some per-rule patches afterwards.
Hi Adam, On So. 13. Jun. 2004, 11:16:39, ADAMK wrote: Show quoted text
> Went to try to add Class::Autouse support for Module::Scandeps and > discovered it uses a "chunk" concept, where a chunk is split /;/ > within a single line. > > Which is useless to me, since I have tons of > > use Class::Autouse 'CGI', > 'Class::Inspector', > 'File::Find::Rule', > etc, > etc; > > SO! > > Scanning for things like use base and use Class::Autouse etc need to > be broken out into a seperate scan area. > > The best method to use would be something like the following untested > code. > > $_ = $all_file_content; > while ( m/(?<=\n)\s*use\s+base\b\s*(.+?)\;/m ) { > free_from_evil( $1 ) or die "WTF is this... '$1'"; > eval "@classes = ($1)"; > add_classes( @classes ); > } > > you get the idea. > > I'd probably wrap the whole '(newline)(pattern)(arguments across > multiple lines)' concept up into a single function of something. > > Anyways, if you can add the basic infrastructure ( and maybe drop some > comments in while you are there ) I can do some per-rule patches > afterwards.
What's the status of this request? It's been filed against 0.44 and without jumping at the code, I cannot tell whether the situation has improved since then. What do you think should be done? Steffen
Subject: Re: [rt.cpan.org #6611] The 'chunk' concept for things like 'use base' is totally wrong
Date: Tue, 21 Feb 2006 02:35:08 +1100
To: bug-Module-ScanDeps [...] rt.cpan.org
From: Adam Kennedy <adam [...] phase-n.com>
Rewrite the whole thing with PPI. You can safely kill that ticket. If I care enough I'll write Perl::ScanDeps. Adam K Steffen Müller via RT wrote: Show quoted text
> Hi Adam, > > On So. 13. Jun. 2004, 11:16:39, ADAMK wrote:
>> Went to try to add Class::Autouse support for Module::Scandeps and >> discovered it uses a "chunk" concept, where a chunk is split /;/ >> within a single line. >> >> Which is useless to me, since I have tons of >> >> use Class::Autouse 'CGI', >> 'Class::Inspector', >> 'File::Find::Rule', >> etc, >> etc; >> >> SO! >> >> Scanning for things like use base and use Class::Autouse etc need to >> be broken out into a seperate scan area. >> >> The best method to use would be something like the following untested >> code. >> >> $_ = $all_file_content; >> while ( m/(?<=\n)\s*use\s+base\b\s*(.+?)\;/m ) { >> free_from_evil( $1 ) or die "WTF is this... '$1'"; >> eval "@classes = ($1)"; >> add_classes( @classes ); >> } >> >> you get the idea. >> >> I'd probably wrap the whole '(newline)(pattern)(arguments across >> multiple lines)' concept up into a single function of something. >> >> Anyways, if you can add the basic infrastructure ( and maybe drop some >> comments in while you are there ) I can do some per-rule patches >> afterwards.
> > What's the status of this request? It's been filed against 0.44 and > without jumping at the code, I cannot tell whether the situation has > improved since then. What do you think should be done? > > Steffen