aboutsummaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2015-10-11 14:19:13 -0400
committerMike Frysinger <vapier@gentoo.org>2015-10-11 14:19:13 -0400
commitea895af0e5a9f22f71ba695dcb7fd6c8f6f0ce70 (patch)
tree65dcddee91a12f125869016c7201e6aa3d05ec82 /bin
parentstagebase: seed initial make.conf w/LC_MESSAGES=C (diff)
downloadcatalyst-ea895af0e5a9f22f71ba695dcb7fd6c8f6f0ce70.tar.gz
catalyst-ea895af0e5a9f22f71ba695dcb7fd6c8f6f0ce70.tar.bz2
catalyst-ea895af0e5a9f22f71ba695dcb7fd6c8f6f0ce70.zip
pylint: scan all modules by default
Add a quick shortcut to scan all the modules in the tree.
Diffstat (limited to 'bin')
-rwxr-xr-xbin/pylint17
1 files changed, 17 insertions, 0 deletions
diff --git a/bin/pylint b/bin/pylint
index 1a50609c..b0018278 100755
--- a/bin/pylint
+++ b/bin/pylint
@@ -10,10 +10,27 @@ import os
import sys
+def find_all_modules(source_root):
+ """Locate all python modules in the tree for scanning"""
+ ret = []
+
+ for root, _dirs, files in os.walk(source_root, topdown=False):
+ # Add all of the .py modules in the tree.
+ ret += [os.path.join(root, x) for x in files if x.endswith('.py')]
+
+ # Add the main scripts that don't end in .py.
+ ret += [os.path.join(source_root, 'bin', x) for x in ('catalyst', 'pylint')]
+
+ return ret
+
+
def main(argv):
"""The main entry point"""
source_root = os.path.dirname(os.path.dirname(os.path.realpath(__file__)))
+ if not argv:
+ argv = find_all_modules(source_root)
+
pympath = source_root
pythonpath = os.environ.get('PYTHONPATH')
if pythonpath is None: