aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README.md1
-rw-r--r--rh/hooks.py4
2 files changed, 4 insertions, 1 deletions
diff --git a/README.md b/README.md
index b19a68b..d656ef3 100644
--- a/README.md
+++ b/README.md
@@ -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',
}