Permalink
Browse files

make critic happy again

  • Loading branch information...
1 parent 2b11462 commit 31285a66e638876e7a26aa4f7f3a81fb220bf5d1 @kentfredric kentfredric committed Apr 6, 2011
Showing with 22 additions and 5 deletions.
  1. +6 −0 Changes
  2. +14 −3 lib/Dist/Zilla/Plugin/MetaProvides/Class.pm
  3. +2 −2 perlcritic.rc
View
@@ -5,6 +5,12 @@ Revision history for {{$dist->name}}
- Move to @Author::KENTNL
- Stricitify critic.
+ [Documentation]
+ - Fix some bad POD links.
+
+ [Internals]
+ - Reorederd some code to reduce cognitive complexity.
+
1.12044911 2010-11-08 12:10:31 Pacific/Auckland
Reinsert MooseX::Declare into deps, got lost due to the t/ to corpus/ move.
@@ -47,7 +47,7 @@ has '+meta_noindex' => ( default => sub { 1 } );
=head2 provides
-A conformant function to the L<Dist::Zila::Role::MetaProvider::Provider> Role.
+A conformant function to the L<Dist::Zilla::Role::MetaProvider::Provider> Role.
=head3 signature: $plugin->provides()
@@ -57,12 +57,19 @@ A conformant function to the L<Dist::Zila::Role::MetaProvider::Provider> Role.
sub provides {
my $self = shift;
- my $perl_module = sub { $_->name =~ m{^lib\/.*\.(pm|pod)$} };
+ my $perl_module = sub {
+ ## no critic ( RegularExpressions )
+ $_->name =~ m{^lib[/].*[.](pm|pod)$}
+ };
my $get_records = sub {
$self->_classes_for( $_->name, $_->content );
};
- return $self->_apply_meta_noindex( $self->zilla->files->grep($perl_module)->map($get_records)->flatten );
+ my ( @files ) = $self->zilla->files->flatten;
+
+ my ( @records ) = @files->grep($perl_module)->map($get_records)->flatten ;
+
+ return $self->_apply_meta_noindex( @records );
}
=head1 PRIVATE METHODS
@@ -92,6 +99,8 @@ sub _classes_for {
};
# I'm being bad and using a private function, but meh.
+ # We know this is bad :(
+ ## no critic ( ProtectPrivateSubs )
return [ Class::Discover->_search_for_classes_in_file( $scanparams, \$content ) ]->map($to_record)->flatten;
}
@@ -106,5 +115,7 @@ sub _classes_for {
=cut
__PACKAGE__->meta->make_immutable;
+no Moose;
+
1;
View
@@ -1,5 +1,5 @@
severity = 1
-exclude = RequireTidyCode RequirePodSections ProhibitPostfixControls RequireRcsKeywords RequireExplicitPackage
+exclude = RequireTidyCode RequirePodSections ProhibitPostfixControls RequireRcsKeywords RequireExplicitPackage RequirePodLinksIncludeText
include = Moose::ProhibitMultipleWiths Moose::ProhibitNewMethod Moose::RequireCleanNamespace Moose::RequireMakeImmutable
color = 1
verbose = 9
@@ -10,7 +10,7 @@ allow_includes = 1
[CodeLayout::ProhibitTrailingWhitespace]
[Documentation::PodSpelling]
-stop_words =
+stop_words = metadata conformant
[Subroutines::ProhibitUnusedPrivateSubroutines]
private_name_regex = _(?!build_)\w

0 comments on commit 31285a6

Please sign in to comment.