diff options
author | 2015-10-05 23:19:43 -0400 | |
---|---|---|
committer | 2015-10-06 14:03:15 -0400 | |
commit | cdfa003b267c02828291c0228d33ea845cb79946 (patch) | |
tree | 77f5f18e8231f9787e0824c739a602e7381d3924 /bin | |
parent | lint: use comments for comments, not inline docstrings (diff) | |
download | catalyst-cdfa003b267c02828291c0228d33ea845cb79946.tar.gz catalyst-cdfa003b267c02828291c0228d33ea845cb79946.tar.bz2 catalyst-cdfa003b267c02828291c0228d33ea845cb79946.zip |
pylint: add a helper for linting code
A bunch of warnings are left disabled because there's too many violations
in the current code base. Hopefully we can get to a point where everyone
uses this though and we can start enabling more and more.
The code base is "clean" right now in the sense that running pylint will
not produce any output. But we should start removing violations one by
one and re-enable the warning class as we go.
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/pylint | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/bin/pylint b/bin/pylint new file mode 100755 index 00000000..1a50609c --- /dev/null +++ b/bin/pylint @@ -0,0 +1,31 @@ +#!/usr/bin/python +# Copyright 1999-2015 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +"""Run pylint with the right settings.""" + +from __future__ import print_function + +import os +import sys + + +def main(argv): + """The main entry point""" + source_root = os.path.dirname(os.path.dirname(os.path.realpath(__file__))) + + pympath = source_root + pythonpath = os.environ.get('PYTHONPATH') + if pythonpath is None: + pythonpath = pympath + else: + pythonpath = pympath + ':' + pythonpath + os.environ['PYTHONPATH'] = pythonpath + + pylintrc = os.path.join(source_root, '.pylintrc') + cmd = ['pylint', '--rcfile', pylintrc] + os.execvp(cmd[0], cmd + argv) + + +if __name__ == '__main__': + main(sys.argv[1:]) |