pep8 & pylint in Emacs

I do a lot of hacking on Python these days, and of course, I use Emacs. The built-in python-mode has the ability to run pychecker on your source, but doesn’t integrate other tools. I like to run pep8.py & pylint regularly to keep my code clean, so I hacked together compilation-derived modes to drive them.

Compile.el is really great for this kind of thing, since it lets you quickly navigate over the lines mentioned in the program’s output. It’s quite efficient, and I enjoy it immensely. One note of interest: pep8.py doesn’t output line numbers in order, which confuses compile-mode. I just pipe the output through sort to work around this.

The code is on GitHub: python-pep8.el and python-pylint.el.

2010/02/12
Previously On Atomized:

Discussion

Seems to be dependent on tramp mode being enabled, i.e. you need to add

(require ‘tramp)

to .emacs before it will work. Nice work though, thanks for this!

Geoff Bache
2010/07/05

Participate