Benchmark-Perl-Formance-Cargo
view release on metacpan or search on metacpan
share/PerlCritic/Critic/Command.pm view on Meta::CPAN
require Perl::Critic;
my %pc_params = (-profile => $EMPTY, -severity => $SEVERITY_LOWEST);
my @policies = Perl::Critic->new( %pc_params )->policies();
my $prototype = Perl::Critic::ProfilePrototype->new( -policies => \@policies );
_out $prototype;
exit $EXIT_SUCCESS;
}
#-----------------------------------------------------------------------------
sub _render_policy_docs {
my (%opts) = @_;
my $pattern = delete $opts{-doc};
require Perl::Critic;
$critic = Perl::Critic->new(%opts);
_set_up_pager($critic->config()->pager());
require Perl::Critic::PolicyFactory;
my @site_policies = Perl::Critic::PolicyFactory->site_policy_names();
my @matching_policies = grep { $_ =~ m/$pattern/ixms } @site_policies;
# "-T" means don't send to pager
my @perldoc_output = map {`perldoc -T $_`} @matching_policies; ## no critic (ProhibitBacktick)
_out @perldoc_output;
exit $EXIT_SUCCESS;
}
#-----------------------------------------------------------------------------
sub _display_version {
_out "$VERSION\n";
exit $EXIT_SUCCESS;
}
#-----------------------------------------------------------------------------
1;
__END__
#-----------------------------------------------------------------------------
=pod
=for stopwords
Twitter
=head1 NAME
Perl::Critic::Command - Guts of L<perlcritic|perlcritic>.
=head1 SYNOPSIS
use Perl::Critic::Command qw< run >;
local @ARGV = qw< --statistics-only lib bin >;
run();
=head1 DESCRIPTION
This is the implementation of the L<perlcritic|perlcritic> command. You can use
this to run the command without going through a command interpreter.
=head1 INTERFACE SUPPORT
This is considered to be a public class. However, its interface is
experimental, and will likely change.
=head1 IMPORTABLE SUBROUTINES
=over
=item C<run()>
Does the equivalent of the L<perlcritic|perlcritic> command. Unfortunately, at
present, this doesn't take any parameters but uses C<@ARGV> to get its
input instead. Count on this changing; don't count on the current
interface.
=back
=head1 TO DO
Make C<run()> take parameters. The equivalent of C<@ARGV> should be
passed as a reference.
Turn this into an object.
=head1 AUTHOR
Jeffrey Ryan Thalhammer <jeff@imaginative-software.com>
=head1 COPYRIGHT
Copyright (c) 2005-2010 Imaginative Software Systems. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the same terms as Perl itself. The full text of this license
can be found in the LICENSE file included with this module.
=cut
##############################################################################
# Local Variables:
# mode: cperl
# cperl-indent-level: 4
# fill-column: 78
# indent-tabs-mode: nil
# c-indentation-style: bsd
( run in 2.521 seconds using v1.01-cache-2.11-cpan-364913b4093 )