diff options
author | Dan Willemsen <dwillemsen@google.com> | 2016-10-21 01:57:13 +0000 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2016-10-21 01:57:13 +0000 |
commit | 194304607077742a4fab45e4a3ff2ae80746b990 (patch) | |
tree | c611eb52ee24bb0be17b6ee9277f0d012272b7df | |
parent | 2c917a92f953a55800f096b4e92b26fc3d35e305 (diff) | |
parent | a1fe889a64469c1cae1d0c81829fc29b5f4f7a5c (diff) | |
download | repohooks-194304607077742a4fab45e4a3ff2ae80746b990.tar.gz |
Merge "Add Tool Path for gofmt"
am: a1fe889a64
Change-Id: I27493ebeb64c49390986b1fbb5c305f2e7e6bbe7
-rw-r--r-- | README.md | 1 | ||||
-rw-r--r-- | rh/hooks.py | 4 |
2 files changed, 4 insertions, 1 deletions
@@ -176,6 +176,7 @@ distros/versions. The following tools are recognized: * `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. +* `gofmt`: used for the `gofmt` builtin hook. * `pylint`: used for the `pylint` builtin hook. Some variables are available to make it easier to handle OS differences. These diff --git a/rh/hooks.py b/rh/hooks.py index b77ee42..1f59dd2 100644 --- a/rh/hooks.py +++ b/rh/hooks.py @@ -330,7 +330,8 @@ def check_gofmt(project, commit, _desc, diff, options=None): if not filtered: return - cmd = ['gofmt', '-l'] + options.args((), filtered) + gofmt = options.tool_path('gofmt') + cmd = [gofmt, '-l'] + options.args((), filtered) ret = [] for d in filtered: data = rh.git.get_file_content(commit, d.file) @@ -442,5 +443,6 @@ TOOL_PATHS = { 'clang-format': 'clang-format', 'cpplint': os.path.join(TOOLS_DIR, 'cpplint.py'), 'git-clang-format': 'git-clang-format', + 'gofmt': 'gofmt', 'pylint': 'pylint', } |