use Moose;
extends 'Perl::Critic::Policy::DynamicMoose';
+use Perl::Critic::Util::Moose 'meta_type';
+
Readonly::Scalar my $EXPL => q{Prefix builder method names with an underscore};
augment applies_to_metaclass => sub { 'Moose::Meta::Role' };
}
if ($builder !~ /^_/) {
- my $desc = "Builder method '$builder' of attribute '$attribute' of class '$classname' is public";
+ my $type = meta_type($meta);
+ my $desc = "Builder method '$builder' of attribute '$attribute' of $type '$classname' is public";
push @violations, $self->violation($desc, $EXPL);
}
}
package Perl::Critic::Util::Moose;
use strict;
use warnings;
-use base 'Exporter';
-
-our @EXPORTS_OK = 'meta_type';
+use Sub::Exporter -setup => {
+ exports => ['meta_type'],
+};
my @types = (
[ 'Moose::Meta::Role' => 'role' ],