diff options
author | Mike Frysinger <vapier@google.com> | 2016-09-15 22:10:24 +0000 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2016-09-15 22:10:24 +0000 |
commit | 36fcda2e19959ff7512e4898ca33fc04a95e3c25 (patch) | |
tree | 5b6469dab7e6dd9b7af526ce27c6cd0e4a65fddc | |
parent | fdc5c159a10793da46d0a10a69b6a18bd77afbdc (diff) | |
parent | 84f9b5dc074f45bfd4f96049653821d33fe55b98 (diff) | |
download | repohooks-36fcda2e19959ff7512e4898ca33fc04a95e3c25.tar.gz |
Merge "pylint: add a tools path config for it" am: 77bdd31937 am: b843789dff
am: 84f9b5dc07
Change-Id: Ic84e501726f302c7a4612bc5f6dedc170c312313
-rw-r--r-- | README.md | 3 | ||||
-rw-r--r-- | rh/hooks.py | 10 |
2 files changed, 9 insertions, 4 deletions
@@ -162,8 +162,9 @@ provide consistent behavior for developers across different OS and Linux distros/versions. The following tools are recognized: * `clang-format`: used for the `clang_format` builtin hook. -* `git-clang-format`: used for the `clang_format` builtin hook. * `cpplint`: used for the `cpplint` builtin hook. +* `git-clang-format`: used for the `clang_format` builtin hook. +* `pylint`: used for the `pylint` builtin hook. Some variables are available to make it easier to handle OS differences. These are automatically expanded for you: diff --git a/rh/hooks.py b/rh/hooks.py index 0f54ff1..e250015 100644 --- a/rh/hooks.py +++ b/rh/hooks.py @@ -339,8 +339,11 @@ def check_pylint(project, commit, _desc, diff, options=None): if not filtered: return - pylint = get_helper_path('pylint.py') - cmd = [pylint] + options.args(('${PREUPLOAD_FILES}',), filtered) + pylint = options.tool_path('pylint') + cmd = [ + get_helper_path('pylint.py'), + '--executable-path', pylint, + ] + options.args(('${PREUPLOAD_FILES}',), filtered) return _check_cmd(project, commit, cmd) @@ -407,6 +410,7 @@ BUILTIN_HOOKS = { # Note: Make sure to keep the top level README.md up to date when adding more! TOOL_PATHS = { 'clang-format': 'clang-format', - 'git-clang-format': 'git-clang-format', 'cpplint': os.path.join(TOOLS_DIR, 'cpplint.py'), + 'git-clang-format': 'git-clang-format', + 'pylint': 'pylint', } |