diff options
author | Alexandre Fayolle <alexandre.fayolle@logilab.fr> | 2008-04-14 17:56:00 +0200 |
---|---|---|
committer | Alexandre Fayolle <alexandre.fayolle@logilab.fr> | 2008-04-14 17:56:00 +0200 |
commit | 3d0a7774fdbbd7cf760a733ee85f310b9ebdace5 (patch) | |
tree | 0d3d533ad244b6fcaa6ecffab20651afefb2ad36 | |
parent | 74db8d1b2815a0dc8b440577820fb09a8c36d4ad (diff) | |
download | pylint-3d0a7774fdbbd7cf760a733ee85f310b9ebdace5.tar.gz |
added pylint/flymake related files
-rw-r--r-- | bin/epylint | 29 | ||||
-rw-r--r-- | elisp/pylint-flymake.el | 11 |
2 files changed, 40 insertions, 0 deletions
diff --git a/bin/epylint b/bin/epylint new file mode 100644 index 0000000..b437e8a --- /dev/null +++ b/bin/epylint @@ -0,0 +1,29 @@ +#!/usr/bin/env python + +import re +import sys + +from subprocess import * + +p = Popen("pylint -f parseable -r n --disable-msg-cat=C,R %s" % + sys.argv[1], shell = True, stdout = PIPE).stdout + +for line in p: + match = re.search("\\[([WE])(, (.+?))?\\]", line) + if match: + kind = match.group(1) + func = match.group(3) + + if kind == "W": + msg = "Warning" + else: + msg = "Error" + + if func: + line = re.sub("\\[([WE])(, (.+?))?\\]", + "%s (%s):" % (msg, func), line) + else: + line = re.sub("\\[([WE])?\\]", "%s:" % msg, line) + print line, + +p.close() diff --git a/elisp/pylint-flymake.el b/elisp/pylint-flymake.el new file mode 100644 index 0000000..835409e --- /dev/null +++ b/elisp/pylint-flymake.el @@ -0,0 +1,11 @@ +(when (load "flymake" t) + (defun flymake-pylint-init () + (let* ((temp-file (flymake-init-create-temp-buffer-copy + 'flymake-create-temp-inplace)) + (local-file (file-relative-name + temp-file + (file-name-directory buffer-file-name)))) + (list "epylint" (list local-file)))) + + (add-to-list 'flymake-allowed-file-name-masks + '("\\.py\\'" flymake-pylint-init))) |