/usr/share/perl5/Dist/Zilla/Plugin/Test/Perl/Critic.pm is in libdist-zilla-plugin-test-perl-critic-perl 2.112410-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 | #
# This file is part of Dist-Zilla-Plugin-Test-Perl-Critic
#
# This software is copyright (c) 2009 by Jerome Quelin.
#
# This is free software; you can redistribute it and/or modify it under
# the same terms as the Perl 5 programming language system itself.
#
use 5.008;
use strict;
use warnings;
package Dist::Zilla::Plugin::Test::Perl::Critic;
{
$Dist::Zilla::Plugin::Test::Perl::Critic::VERSION = '2.112410';
}
# ABSTRACT: tests to check your code against best practices
use Moose;
use Moose::Util qw( get_all_attribute_values );
use Dist::Zilla::File::InMemory;
use Data::Section 0.004 -setup;
# and when the time comes, treat them like templates
with qw(
Dist::Zilla::Role::FileGatherer
Dist::Zilla::Role::TextTemplate
);
has critic_config => (
is => 'ro',
isa => 'Maybe[Str]',
default => 'perlcritic.rc',
);
sub gather_files {
my ($self) = @_;
my $data = $self->merged_section_data;
return unless $data and %$data;
my $stash = get_all_attribute_values( $self->meta, $self);
$stash->{critic_config} ||= 'perlcritic.rc';
# NB: This code is a bit generalised really, and could be forked into its
# own plugin.
for my $name ( keys %$data ){
my $template = ${$data->{$name}};
$self->add_file( Dist::Zilla::File::InMemory->new({
name => $name,
content => $self->fill_in_string( $template, $stash )
}));
}
}
no Moose;
__PACKAGE__->meta->make_immutable;
1;
=pod
=head1 NAME
Dist::Zilla::Plugin::Test::Perl::Critic - tests to check your code against best practices
=head1 VERSION
version 2.112410
=head1 SYNOPSIS
In your dist.ini:
[Test::Perl::Critic]
critic_config = perlcritic.rc ; relative to project root
=head1 DESCRIPTION
This is an extension of L<Dist::Zilla::Plugin::InlineFiles>, providing
the following files:
=over 4
=item * t/author/critic.t - a standard test to check your code against best practices
=back
This plugin accept the C<critic_config> option, to specify your own config
file for L<Perl::Critic>. It defaults to C<perlcritic.rc>, relative to the
project root.
=for Pod::Coverage gather_files
=head1 SEE ALSO
You can look for information on this module at:
=over 4
=item * Search CPAN
L<http://search.cpan.org/dist/Dist-Zilla-Plugin-Test-Perl-Critic>
=item * See open / report bugs
L<http://rt.cpan.org/NoAuth/Bugs.html?Dist=Dist-Zilla-Plugin-Test-Perl-Critic>
=item * Mailing-list (same as L<Dist::Zilla>)
L<http://www.listbox.com/subscribe/?list_id=139292>
=item * Git repository
L<http://github.com/jquelin/dist-zilla-plugin-test-perl-critic>
=item * AnnoCPAN: Annotated CPAN documentation
L<http://annocpan.org/dist/Dist-Zilla-Plugin-Test-Perl-Critic>
=item * CPAN Ratings
L<http://cpanratings.perl.org/d/Dist-Zilla-Plugin-Test-Perl-Critic>
=back
=head1 AUTHOR
Jerome Quelin
=head1 COPYRIGHT AND LICENSE
This software is copyright (c) 2009 by Jerome Quelin.
This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.
=cut
__DATA__
___[ xt/author/critic.t ]___
#!perl
use strict;
use warnings;
use Test::More;
use English qw(-no_match_vars);
eval "use Test::Perl::Critic";
plan skip_all => 'Test::Perl::Critic required to criticise code' if $@;
Test::Perl::Critic->import( -profile => "{{ $critic_config }}" ) if -e "{{ $critic_config }}";
all_critic_ok();
|