Add wrapper script for pylint.
authorCheng Zhao <zcbenz@gmail.com>
Fri, 27 Sep 2013 02:21:49 +0000 (10:21 +0800)
committerCheng Zhao <zcbenz@gmail.com>
Fri, 27 Sep 2013 02:21:49 +0000 (10:21 +0800)
script/pylint.py [new file with mode: 0755]

diff --git a/script/pylint.py b/script/pylint.py
new file mode 100755 (executable)
index 0000000..399bb37
--- /dev/null
@@ -0,0 +1,22 @@
+#!/usr/bin/env python
+
+import glob
+import os
+import subprocess
+import sys
+
+SOURCE_ROOT = os.path.dirname(os.path.dirname(__file__))
+
+
+def main():
+  os.chdir(SOURCE_ROOT)
+
+  pylint = os.path.join(SOURCE_ROOT, 'vendor', 'depot_tools', 'pylint.py')
+  settings = ['--rcfile=vendor/depot_tools/pylintrc']
+  pys = glob.glob('script/*.py') + [os.path.join('script', 'lib')]
+  subprocess.check_call([sys.executable, pylint] + settings + pys,
+                        env=dict(PYTHONPATH='script'))
+
+
+if __name__ == '__main__':
+  sys.exit(main())