App-Critique

 view release on metacpan or  search on metacpan

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

    if ( @removed_files ) {
        info('Found %s removed file(s).', format_number(scalar @removed_files));
        
        if ( $opt->verbose || $opt->dry_run ) {
            info(HR_LIGHT);
            info($_->path) foreach @removed_files;
            info(HR_LIGHT);
        }
        
        if ( $opt->dry_run ) {
            info('[dry-run] Would have updated list of %s file(s).', format_number(scalar @preserved_files));
        }
        else {
            $session->set_tracked_files( @preserved_files );
            $session->reset_file_idx;
            info('Sucessfully updated list of %s file(s).', format_number(scalar @preserved_files));

            $self->cautiously_store_session( $session, $opt, $args );
            info('Session file stored successfully (%s).', $session->session_file_path);
        }
    }
    else {
        info('Nothing to remove, so nothing to change, so session file is untouched.');
    }

}

t/060-clean.t  view on Meta::CPAN

                '-v',
                '--git-work-tree', $work_tree,
            )
        ],
        [
            qr/Session file loaded/,
            qr/Reviewing 7 file\(s\)/,
            qr/Found 2 removed file\(s\)/,
            qr/$work_tree\/lib\/My\/Test\/WithoutViolations\.pm/,
            qr/$work_tree\/lib\/My\/Test\/WithViolations\.pm/,
            qr/Sucessfully updated list of 5 file\(s\)/,
        ],
        [
            qr/Unable to load session file/,
            qr/Unable to store session file/,
        ]
    );

    # warn '-' x 80;
    # warn $out;
    # warn '-' x 80;



( run in 0.360 second using v1.01-cache-2.11-cpan-05444aca049 )