App-Critique

 view release on metacpan or  search on metacpan

lib/App/Critique/Command/clean.pm  view on Meta::CPAN


use App::Critique::Session;

use App::Critique -command;

sub opt_spec {
    my ($class) = @_;
    return (
        [ 'dry-run', 'display the pruned list of files, but do not overwrite' ],
        [],
        $class->SUPER::opt_spec,
    );
}

sub execute {
    my ($self, $opt, $args) = @_;

    my $session = $self->cautiously_load_session( $opt, $args );

    info('Session file loaded.');

lib/App/Critique/Command/collect.pm  view on Meta::CPAN

        [],
        [ 'no-violation',  'filter files that contain no Perl::Critic violations ' ],
        [],
        [ 'filter|f=s',    'filter files to remove with this regular expression' ],
        [ 'match|m=s',     'match files to keep with this regular expression' ],
        [],
        [ 'n=i',           'number of concurrent processes across which to partition the filtering job', { default => 0 } ],
        [],
        [ 'dry-run',       'display list of files, but do not store them' ],
        [],
        $class->SUPER::opt_spec,
    );
}

our $PAUSE_PROCESSING = 0;

sub execute {
    my ($self, $opt, $args) = @_;

    local $Term::ANSIColor::AUTORESET = 1;

lib/App/Critique/Command/init.pm  view on Meta::CPAN


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 {
    my ($self, $opt, $args) = @_;

    if ( $opt->verbose ) {
        info(HR_LIGHT);
        info('Attempting to initialize session file using the following options:');
        info(HR_LIGHT);

lib/App/Critique/Command/process.pm  view on Meta::CPAN

sub opt_spec {
    my ($class) = @_;
    return (
        [ 'reset',  'resets the file index to 0',            { default => 0 } ],
        [ 'back',   'back up and re-process the last file',  { default => 0 } ],
        [ 'next',   'skip over processing the current file', { default => 0 } ],
        [ 'goto=i', 'goto to file at given index' ],
        [],
        [ 'blame', 'show the `git blame` block for each violation', { default => 0 } ],
        [],
        $class->SUPER::opt_spec
    );
}

sub execute {
    my ($self, $opt, $args) = @_;

    error('No acceptable value found for EDITOR in the critique config, please set one.')
        unless $App::Critique::CONFIG{EDITOR};

    local $Term::ANSIColor::AUTORESET = 1;

lib/App/Critique/Command/remove.pm  view on Meta::CPAN


use App::Critique::Session;

use App::Critique -command;

sub opt_spec {
    my ($class) = @_;
    return (
        [ 'dry-run', 'display list of files to be removed, but do not remove them' ],
        [],
        $class->SUPER::opt_spec,
    );
}

sub execute {
    my ($self, $opt, $args) = @_;

    my $session_file = App::Critique::Session->locate_session_file( $opt->git_work_tree );

    if (not -e $session_file) {
        if ( $opt->verbose ) {



( run in 1.637 second using v1.01-cache-2.11-cpan-49f99fa48dc )