diff options
author | Luis Hector Chavez <lhchavez@google.com> | 2016-12-23 00:04:32 +0000 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2016-12-23 00:04:32 +0000 |
commit | e41e82789dc0978659f23dd324cacc3f5a85b6b1 (patch) | |
tree | a9662a2e6651be7b0f9608001b0b1b785adbd9ef | |
parent | 436e1deb9f1752c51df9018e5078f5b14f728c85 (diff) | |
parent | 7e74f70baf4beeae0cc22e4c380febbe5b5d0cc0 (diff) | |
download | repohooks-e41e82789dc0978659f23dd324cacc3f5a85b6b1.tar.gz |
Add support for automatic fixups to google-java-format am: d1fd88b71c am: 1f99b7db96 am: 086a189a96
am: 7e74f70baf
Change-Id: I0e57dd108fe8241c36c39ed1f255fb5b7a87f3df
-rw-r--r-- | rh/hooks.py | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/rh/hooks.py b/rh/hooks.py index 47926bc..4e456e1 100644 --- a/rh/hooks.py +++ b/rh/hooks.py @@ -315,10 +315,13 @@ def check_google_java_format(project, commit, _desc, _diff, options=None): tool = get_helper_path('google-java-format.py') google_java_format = options.tool_path('google-java-format') google_java_format_diff = options.tool_path('google-java-format-diff') - cmd = [tool, '--google-java-format', google_java_format, - '--google-java-format-diff', google_java_format_diff, - '--commit', commit] + options.args() - return _check_cmd('google-java-format', project, commit, cmd) + tool_args = ['--google-java-format', google_java_format, + '--google-java-format-diff', google_java_format_diff, + '--commit', commit] + options.args() + cmd = [tool] + tool_args + fixup_func = _fixup_func_caller([tool, '--fix'] + tool_args) + return _check_cmd('google-java-format', project, commit, cmd, + fixup_func=fixup_func) def check_commit_msg_bug_field(project, commit, desc, _diff, options=None): |