KomodoIntegration - Integrating perlcritic and Komodo
This document describes the steps for integrating perlcritic with Komodo 4.0 from ActiveState. More information about Komodo can be found at http://www.activestate.com
These instructions assume that perlcritic has been installed somewhere in your $PATH. If it is not in your $PATH, you must give the full path to perlcritic instead of using the -S switch. Also, I'm assuming that you have installed Perl-Critic with the same Perl that Komodo is using. If that is not the case, you'll probably have to give a full path to perl instead of using the %perl placeholder.
$PATH
-S
%perl
Start Komodo.
Select Toolbox -> Add -> New Command... from the menu.
Toolbox -> Add -> New Command...
Enter a name for the command (e.g. "perlcritic").
In the Command: field, enter the following:
Command:
%perl -S perlcritic --severity=%(ask:Severity level [1-5]?:5) --verbose=1 %F
Uncheck the Insert output and Pass selection as input boxes.
Insert output
Pass selection as input
In the Run in: drop-down list, select Command Output Tab.
Run in:
Command Output Tab
Uncheck the Do not open output pane box.
Do not open output pane
Check the Parse output with: box, and type this into the field:
Parse output with:
^(?P<file>.+):(?P<line>.+):(?P<column>.+):(?P<content>.+)$
Check the Show parsed output as a list box.
Show parsed output as a list
Click the Key Binding tab.
Key Binding
Click the New Key Sequence text field, and press Ctrl-Alt-p.
New Key Sequence
Ctrl-Alt-p
Click the Add button.
Add
Click the OK button.
OK
Now to run perlcritic on the current file, just press Ctrl-Alt-p, or select perlcritic from the Toolbox menu. Each time, you will be prompted to enter the minimum severity level (defaulting to 5). After a few moments, the output will appear in the Command Output pane. By double-clicking on the output messages, you can navigate to the appropriate point in the code.
perlcritic
Toolbox
Command Output
Jeffrey Ryan Thalhammer <thaljef@cpan.org>
Copyright (c) 2005-2007 Jeffrey Ryan Thalhammer. All rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. The full text of this license can be found in the LICENSE file included with this module.
To install Perl::Critic, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Perl::Critic
CPAN shell
perl -MCPAN -e shell install Perl::Critic
For more information on module installation, please visit the detailed CPAN module installation guide.