App-Critique
view release on metacpan or search on metacpan
lib/App/Critique/Command/init.pm view on Meta::CPAN
our $VERSION = '0.05';
our $AUTHORITY = 'cpan:STEVAN';
use App::Critique::Session;
use App::Critique -command;
sub opt_spec {
my ($class) = @_;
return (
[ 'perl-critic-profile=s', 'path to a Perl::Critic profile to use (default let Perl::Critic decide)' ],
[ 'perl-critic-theme=s', 'Perl::Critic theme expression to use' ],
[ 'perl-critic-policy=s', 'singular Perl::Critic policy to use (overrides -theme and -policy)' ],
[],
[ 'force', 'force overwriting of existing session file' ],
[],
$class->SUPER::opt_spec,
)
}
sub execute {
lib/App/Critique/Command/process.pm view on Meta::CPAN
$idx = $session->current_file_idx;
$file = $tracked_files[ $idx ];
my $path = $file->relative_path( $session->git_work_tree_root );
info('Running Perl::Critic against (%s)', $path);
info(HR_LIGHT);
# perlcritic can fail, so lets guard against it and let the user
# decide if they want to carry on
my @violations;
eval {
@violations = $self->discover_violations( $session, $file, $opt );
1;
} or do {
info(HR_ERROR);
warn($@);
info(HR_LIGHT);
my $should_review = prompt_yn(
BOLD(sprintf 'A error has occurred do you want to continue?'),
( run in 0.226 second using v1.01-cache-2.11-cpan-de7293f3b23 )