App-Critique
view release on metacpan or search on metacpan
lib/App/Critique/Command/tutorial.pm view on Meta::CPAN
package App::Critique::Command::tutorial;
use strict;
use warnings;
our $VERSION = '0.05';
our $AUTHORITY = 'cpan:STEVAN';
use App::Critique -command;
sub opt_spec { return ([]) }
sub validate_args { 1 }
sub execute { info( $_[0]->description ) }
1;
=pod
=head1 NAME
App::Critique::Command::tutorial - Tutorial about how to use critique
=head1 VERSION
version 0.05
=head1 DESCRIPTION
Here is a short description of one my workflows. One thing to note is
that there is a pretty extensive help system here, so anytime you need
more info you can just do F<critique help> or F<critique help $command_name>
and get more info.
=head2 Setup
The very first thing you need to do is navigate to a git checkout
directory. Just like F<git> itself, F<critique> needs a working
directory to do its work in.
=head2 Initialize
Next you need to initialise a F<critique> session, I have found that
focusing on a single L<Perl::Critic> policy at a time can be helpful
and so I use the line below to initialize my session.
> critique init -v --perl-critic-policy Variables::ProhibitUnusedVariables
You will likely want to include the C<-v> (verbose) flag at a minimum,
but there is also a C<-d> (debug) flag which can be helpful.
=head2 Collect
Next you want to ask F<critique> to find all the files you want to
process. This will basically just traverse the directory tree and
find all the available perl files, and looks like this:
> critique collect -v --root lib/ExampleCompany/
You can also provide different criteria to help create the file list
that you want. You can do this in a few ways, here are some examples.
> critique collect -v --root lib/ --filter ExampleCompany/Db/
This would traverse the F<lib/> directory, but exclude any paths
which match the C<--filter> passed.
> critique collect -v --root lib/ --match /Db/
You can also specify what to include using the C<--match> argument,
the above will traverse F<lib/> but only match files which have
a F</Db/> folder in their path.
( run in 0.590 second using v1.01-cache-2.11-cpan-39bf76dae61 )