Subject: | Perl::Critic::Utils::all_perl_files option to skip symlinks |
all_perl_files('.') will recurse into subdirectories, including symlinks.
This can be slow if you have a symlink to some big directory. It would
be useful to have an option to not follow symlinks.
Clearly the code change is simple, but a good interface for it is
trickier. Currently all_perl_files takes a list of directory names;
perhaps if the first argument is a code ref, it is used to filter
directories:
@files = all_perl_files sub { not(-l $_[0]) }, '.';
Would you consider adding that enhancement to the library?
For the perlcritic command line tool, I'm tempted to say it should print
a warning message such as
Looking inside symbolic-linked directories, such as ./foo
if it finds such a thing and --quiet is not set. Then nobody would
wonder why a perlcritic run that used to run quickly is now apparently
hanging.