Flymake mode is an Emacs mode that allows you to run continuous syntax checks against the current buffer "While U Type".
Perl::Critic is a static analysis tool for Perl that can be configured to produce a wide range of warnings and errors according to various customizable coding standards.
Emacs-flymake-perlcritic glues the two together, giving you continuous static analysis as you edit.
You will also need Perl::Critic installed, this can be installed via CPAN:
- cpan Perl::Critic
Once you have both of those installed you can install flymake-perlcritic.el somewhere that emacs can find it and add something like the following to your .emacs:
;; If flymake_perlcritic isn't found correctly, specify the full path (setq flymake-perlcritic-command "~/projects/emacs-flymake-perlcritic/bin/flymake_perlcritic") ;; Lets set it to be the most severe available. (setq flymake-perlcritic-severity 1) ;; If you don't want to use the default ~/.perlcriticrc (setq flymake-perlcritic-profile "~/projects/big-project/perlcriticrc") (require 'flymake-perlcritic)
- Perl syntax checking also uses "perl -c", which executes BEGIN blocks, this can be considered a security vulnerability when opening untrusted files. For more information: http://stackoverflow.com/a/12908487/870000
You might also be interested in my patched version of flymake.el which contains fixes and enhancements that can be used by flymake-perlcritic.el, you can grab it from here: