return;
}
-sub delegation_metaclass() { 'Mouse::Meta::Method::Delegation' }
+sub delegation_metaclass() { ## no critic
+ 'Mouse::Meta::Method::Delegation'
+}
sub _canonicalize_handles {
my($self, $handles) = @_;
}
my %seen;
- return sort grep { !$seen{$_}++ }
+ return sort grep { !$seen{$_}++ } ## no critic
(map{ $_->name } map{ $_->meta->calculate_all_roles } @self_anon_supers),
(map{ $_->name } map{ $_->meta->calculate_all_roles } @other_anon_supers),
;
package Mouse::Util;
use Mouse::Exporter; # enables strict and warnings
-sub get_linear_isa($;$); # must be here
+# must be here because it will be refered by other modules loaded
+sub get_linear_isa($;$); ## no critic
-sub install_subroutines { # must be here
+# must be here because it will called in Mouse::Exporter
+sub install_subroutines {
my $into = shift;
while(my($name, $code) = splice @_, 0, 2){
# sugars
-sub as ($) { (as => $_[0]) }
-sub where (&) { (where => $_[0]) }
-sub message (&) { (message => $_[0]) }
-sub optimize_as (&) { (optimize_as => $_[0]) }
+sub as ($) { (as => $_[0]) } ## no critic
+sub where (&) { (where => $_[0]) } ## no critic
+sub message (&) { (message => $_[0]) } ## no critic
+sub optimize_as (&) { (optimize_as => $_[0]) } ## no critic
sub from { @_ }
-sub via (&) { $_[0] }
+sub via (&) { $_[0] } ## no critic
# type utilities
## exported functions
-sub meta_ok ($;$) {
+sub meta_ok ($;$) { ## no critic
my ($class_or_obj, $message) = @_;
$message ||= "The object has a meta";
}
}
-sub does_ok ($$;$) {
+sub does_ok ($$;$) { ## no critic
my ($class_or_obj, $does, $message) = @_;
$message ||= "The object does $does";
}
}
-sub has_attribute_ok ($$;$) {
+sub has_attribute_ok ($$;$) { ## no critic
my ($class_or_obj, $attr_name, $message) = @_;
$message ||= "The object does has an attribute named $attr_name";
}
}
-sub with_immutable (&@) {
+sub with_immutable (&@) { ## no critic
my $block = shift;
my $before = $Test->current_test;
use Mouse::Util; # enables strict and warnings
-BEGIN {
- my $package;
- sub import {
- $package = $_[1] || 'Class';
- if ($package =~ /^\+/) {
- $package =~ s/^\+//;
- Mouse::Util::load_class($package);
- }
+
+my $package = 'Class';
+sub import {
+ $package = $_[1] || 'Class';
+ if ($package =~ /^\+/) {
+ $package =~ s/^\+//;
+ Mouse::Util::load_class($package);
}
- use Filter::Simple sub { s/^/package $package;\nuse Mouse;\nuse Mouse::Util::TypeConstraints;\n/; }
}
+use Filter::Simple sub { s/^/package $package;\nuse Mouse;\nuse Mouse::Util::TypeConstraints;\n/; };
1;
__END__
# This file was generated by $0 from Mouse $Mouse::Spec::VERSION.
#
# ANY CHANGES MADE HERE WILL BE LOST!
-
+use strict;
+use warnings;
EOF
print { $handle } << 'EOF';
--- /dev/null
+use strict;
+use Test::More;
+eval {
+ require Perl::Critic;
+ Perl::Critic->VERSION(1.105);
+
+ require Test::Perl::Critic;
+ Test::Perl::Critic->import( -profile => \join q{}, <DATA>);
+};
+plan skip_all => "Test::Perl::Critic is not installed." if $@;
+all_critic_ok('lib');
+
+__END__
+
+exclude=ProhibitStringyEval ProhibitExplicitReturnUndef RequireBarewordIncludes
+
+[TestingAndDebugging::ProhibitNoStrict]
+allow=refs
+
+[TestingAndDebugging::RequireUseStrict]
+equivalent_modules = Mouse Mouse::Exporter Mouse::Util Mouse::Util::TypeConstraints
+
+[TestingAndDebugging::RequireUseWarnings]
+equivalent_modules = Mouse Mouse::Exporter Mouse::Util Mouse::Util::TypeConstraints
+