aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLiz Kammer <eakammer@google.com>2020-10-20 17:25:04 +0000
committerAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2020-10-20 17:25:04 +0000
commit3785f05256bf78719082cef93aaed3d08c1863d8 (patch)
tree7123ba7d87643f6c167df22c25addd069810627f
parenteb433868757764e154d396d3627417747db9a743 (diff)
parent239625cee5e913e15ea070862a7921759d27dca6 (diff)
downloadrepohooks-3785f05256bf78719082cef93aaed3d08c1863d8.tar.gz
Add support for automatic fixups to gofmt. am: 239625cee5
Original change: https://android-review.googlesource.com/c/platform/tools/repohooks/+/1408931 Change-Id: Ieb4c41d997b5ddd49d9f58a1f257e56e53456dd0
-rw-r--r--rh/hooks.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/rh/hooks.py b/rh/hooks.py
index 491da91..dd4cab3 100644
--- a/rh/hooks.py
+++ b/rh/hooks.py
@@ -771,9 +771,10 @@ def check_gofmt(project, commit, _desc, diff, options=None):
data = rh.git.get_file_content(commit, d.file)
result = _run(cmd, input=data)
if result.stdout:
+ fixup_func = _fixup_func_caller([gofmt, '-w', d.file])
ret.append(rh.results.HookResult(
'gofmt', project, commit, error=result.stdout,
- files=(d.file,)))
+ files=(d.file,), fixup_func=fixup_func))
return ret