summaryrefslogtreecommitdiff
path: root/epylint.py
diff options
context:
space:
mode:
authorSylvain Th?nault <sylvain.thenault@logilab.fr>2013-10-07 12:17:27 +0200
committerSylvain Th?nault <sylvain.thenault@logilab.fr>2013-10-07 12:17:27 +0200
commitc788c70f20aa9b08a9a2f7b4e5e6e4e48b41e296 (patch)
treee71528e932f9b1376bd79e227f40c34fb8b007da /epylint.py
parentb78c325b3f5f7d8330fbf30c54b5ea1baf2b930f (diff)
downloadpylint-c788c70f20aa9b08a9a2f7b4e5e6e4e48b41e296.tar.gz
epylint command line was omitting options
Diffstat (limited to 'epylint.py')
-rwxr-xr-xepylint.py30
1 files changed, 16 insertions, 14 deletions
diff --git a/epylint.py b/epylint.py
index 76d7b68..d22d89c 100755
--- a/epylint.py
+++ b/epylint.py
@@ -53,17 +53,18 @@ from subprocess import Popen, PIPE
def lint(filename, options=None):
"""Pylint the given file.
- When run from emacs we will be in the directory of a file, and passed its filename.
- If this file is part of a package and is trying to import other modules from within
- its own package or another package rooted in a directory below it, pylint will classify
- it as a failed import.
-
- To get around this, we traverse down the directory tree to find the root of the package this
- module is in. We then invoke pylint from this directory.
-
- Finally, we must correct the filenames in the output generated by pylint so Emacs doesn't
- become confused (it will expect just the original filename, while pylint may extend it with
- extra directories if we've traversed down the tree)
+ When run from emacs we will be in the directory of a file, and passed its
+ filename. If this file is part of a package and is trying to import other
+ modules from within its own package or another package rooted in a directory
+ below it, pylint will classify it as a failed import.
+
+ To get around this, we traverse down the directory tree to find the root of
+ the package this module is in. We then invoke pylint from this directory.
+
+ Finally, we must correct the filenames in the output generated by pylint so
+ Emacs doesn't become confused (it will expect just the original filename,
+ while pylint may extend it with extra directories if we've traversed down
+ the tree)
"""
# traverse downwards until we are out of a python package
fullPath = os.path.abspath(filename)
@@ -153,7 +154,8 @@ def py_run(command_options='', return_std=False, stdout=None, stderr=None,
else:
stderr = sys.stderr
# Call pylint in a subprocess
- p = Popen(command_line, shell=True, stdout=stdout, stderr=stderr, universal_newlines=True)
+ p = Popen(command_line, shell=True, stdout=stdout, stderr=stderr,
+ universal_newlines=True)
p.wait()
# Return standart output and error
if return_std:
@@ -165,10 +167,10 @@ def Run():
print "Usage: %s <filename> [options]" % sys.argv[0]
sys.exit(1)
elif not os.path.exists(sys.argv[1]):
- print "%s does not exist" % sys.argv[1]
+ print "%s does not exist" % sys.argv[1]
sys.exit(1)
else:
- sys.exit(lint(sys.argv[1]))
+ sys.exit(lint(sys.argv[1], sys.argv[1:]))
if __name__ == '__main__':