Perl-Critic

 view release on metacpan or  search on metacpan

bin/perlcritic  view on Meta::CPAN


Joshua ben Jore has authored a minor-mode for emacs that allows you to run
perlcritic on the current region or buffer.  You can run it on demand, or
configure it to run automatically when you save the buffer. The output appears
in a hot-linked compiler buffer.  The code and installation instructions can
be found in the F<extras> directory inside this distribution.


=head2 VIM

Scott Peshak has published F<perlchecker.vim>, which is available at
L<http://www.vim.org/scripts/script.php?script_id=1731>.


=head2 gVIM

Fritz Mehner recently added support for C<perlcritic> to his fantastic gVIM
plugin.  In addition to providing a very Perlish IDE, Fritz's plugin enables
one-click access to C<perlcritic> and many other very useful utilities.  And
all is seamlessly integrated into the editor. See
L<http://lug.fh-swf.de/vim/vim-perl/screenshots-en.html> for complete details.


=head2 EPIC

EPIC is an open source Perl IDE based on the Eclipse platform. Features
include syntax highlighting, on-the-fly syntax check, content assist, code
completion, perldoc support, source formatting with L<Perl::Tidy|Perl::Tidy>,
code templates, a regular expression editing tool, and integration with the
Perl debugger.  Recent versions of EPIC also have built-in support for
Perl::Critic.  At least one Perl::Critic contributor swears by EPIC.  Go to
L<http://e-p-i-c.sourceforge.net> for more information about EPIC.

=head2 BBEdit

Josh Clark has produced an excellent Perl-Critic plugin for BBEdit. See
L<http://globalmoxie.com/projects/bbedit-perl-critic/index.shtml> for
download, installation, and usage instructions.  Apple users rejoice!


=head2 Komodo

Komodo is a proprietary IDE for Perl and several other dynamic languages.
Starting in version 5.1.1, Komodo has built-in support for Perl-Critic, if you
have the L<Perl::Critic> and L<criticism> modules installed.  Free trial
copies of Komodo can be obtained from the ActiveState website at
L<http://www.activestate.com>.


=head2 ActivePerl

ActivePerl includes a very slick graphical interface for configuring and
running Perl-Critic called C<perlcritic-gui>.  A free community edition of
ActivePerl can be obtained from the ActiveState website at
L<http://www.activestate.com>.


=head2 Visual Studio Code

Visual Studio Code is a lightweight but powerful source code editor which
runs on your desktop and is available for Windows, macOS and Linux.

The perlcritic extension can be found here:
L<https://marketplace.visualstudio.com/items?itemName=sfodje.perlcritic>

The steps to install the perlcritic extension:

=over

=item 1. Menu: View->Command Palette

=item 2. Type in "Extensions"

=item 3. Select "Extensions: Install Extension"

=item 4. In the search box type "perlcritic" and the extensions pane will open.

=item 5. perlcritic should be the first entry

=item 6. Select the "install" button

=item 7. Once installed go to Preferences->Settings

=item 8. Type in "perlcritic" in the search box

=item 9. The settings options for perlcritic will show and you configure the extension here.

=item 9a. If you want perlcritic to run automatically when the file is saved, select "only critique on save".

=back

Open a Perl file. Save it and perlcritic should fire. There is a triangle
with an exclamation point on the status bar. Click it and it will open the
issues that perlcritic has found.


=head1 EXIT STATUS

If C<perlcritic> has any errors itself, exits with status == 1.  If there are
no errors, but C<perlcritic> finds Policy violations in your source code,
exits with status == 2.  If there were no errors and no violations were found,
exits with status == 0.


=head1 THE L<Perl::Critic> PHILOSOPHY

=over

Coding standards are deeply personal and highly subjective.  The goal of
Perl::Critic is to help you write code that conforms with a set of best
practices.  Our primary goal is not to dictate what those practices are, but
rather, to implement the practices discovered by others.  Ultimately, you make
the rules -- Perl::Critic is merely a tool for encouraging consistency.  If
there is a policy that you think is important or that we have overlooked, we
would be very grateful for contributions, or you can simply load your own
private set of policies into Perl::Critic.

=back


=head1 EXTENDING THE CRITIC



( run in 0.881 second using v1.01-cache-2.11-cpan-a49fcb8fa48 )