I just installed pylint from source, and can't get epylint to work when called from within emacs. It works fine when called from the command line.
In my .emacs file, I've defined a 'pylint' function as follows:
(defun pylint ()
(interactive)
(compile (concat "epylint " buffer-file-name)))
When I run M-x pylint
from within emacs, I get the following error:
-*- mode: compilation; default-directory: "~/projects/external/pylearn2/pylearn2/scripts/papers/maxout/tests/" -*-
Compilation started at Sun Sep 14 15:54:49
epylint /home/mkg/projects/external/pylearn2/pylearn2/scripts/papers/maxout/tests/test_model.py
Warning: option include-ids is deprecated and ignored.
Warning: option symbols is deprecated and ignored.
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/pylint-1.3.0-py2.7.egg/pylint/lint.py", line 1085, in
Run(sys.argv[1:])
File "/usr/local/lib/python2.7/dist-packages/pylint-1.3.0-py2.7.egg/pylint/lint.py", line 1025, in __init__
linter.check(args)
File "/usr/local/lib/python2.7/dist-packages/pylint-1.3.0-py2.7.egg/pylint/lint.py", line 608, in check
self.check_astroid_module(astroid, walker, rawcheckers, tokencheckers)
File "/usr/local/lib/python2.7/dist-packages/pylint-1.3.0-py2.7.egg/pylint/lint.py", line 685, in check_astroid_module
walker.walk(astroid)
File "/usr/local/lib/python2.7/dist-packages/pylint-1.3.0-py2.7.egg/pylint/utils.py", line 847, in walk
self.walk(child)
File "/usr/local/lib/python2.7/dist-packages/pylint-1.3.0-py2.7.egg/pylint/utils.py", line 847, in walk
self.walk(child)
File "/usr/local/lib/python2.7/dist-packages/pylint-1.3.0-py2.7.egg/pylint/utils.py", line 847, in walk
self.walk(child)
File "/usr/local/lib/python2.7/dist-packages/pylint-1.3.0-py2.7.egg/pylint/utils.py", line 847, in walk
self.walk(child)
File "/usr/local/lib/python2.7/dist-packages/pylint-1.3.0-py2.7.egg/pylint/utils.py", line 847, in walk
self.walk(child)
File "/usr/local/lib/python2.7/dist-packages/pylint-1.3.0-py2.7.egg/pylint/utils.py", line 847, in walk
self.walk(child)
File "/usr/local/lib/python2.7/dist-packages/pylint-1.3.0-py2.7.egg/pylint/utils.py", line 844, in walk
cb(astroid)
File "/usr/local/lib/python2.7/dist-packages/pylint-1.3.0-py2.7.egg/pylint/checkers/typecheck.py", line 282, in visit_getattr
confidence=confidence)
File "/usr/local/lib/python2.7/dist-packages/pylint-1.3.0-py2.7.egg/pylint/checkers/__init__.py", line 97, in add_message
self.linter.add_message(msg_id, line, node, args, confidence)
File "/usr/local/lib/python2.7/dist-packages/pylint-1.3.0-py2.7.egg/pylint/utils.py", line 401, in add_message
(path, module, obj, line or 1, col_offset or 0), msg, confidence))
File "/usr/local/lib/python2.7/dist-packages/pylint-1.3.0-py2.7.egg/pylint/reporters/text.py", line 61, in handle_message
self.write_message(msg)
File "/usr/local/lib/python2.7/dist-packages/pylint-1.3.0-py2.7.egg/pylint/reporters/text.py", line 51, in write_message
self.writeln(msg.format(self._template))
File "/usr/local/lib/python2.7/dist-packages/pylint-1.3.0-py2.7.egg/pylint/utils.py", line 105, in format
return template.format(**dict(zip(self._fields, self)))
KeyError: u'path'
************* Module test_model
Compilation exited abnormally with code 1 at Sun Sep 14 15:54:53
For those who are curious: I'm not using Ubuntu's pylint package anymore because Ubuntu 13.10's pylint is out of date and still contains a bug which makes it useless for use with numpy.
Any suggestions would be much appreciated.