diff options
author | Treehugger Robot <treehugger-gerrit@google.com> | 2022-11-25 07:33:19 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2022-11-25 07:33:19 +0000 |
commit | c9b193c57e35d9b0d6e31a52b43eec3ca7cf1431 (patch) | |
tree | 50fe8359d3f4dbbea70dd99f53dcd06f16f34f24 | |
parent | 3800a36d54030d26e9873d48cf10a70efa494bf4 (diff) | |
parent | e19860bdec77fb77d95fb8ef2e28afbc0b323f9f (diff) | |
download | repohooks-c9b193c57e35d9b0d6e31a52b43eec3ca7cf1431.tar.gz |
Merge "Send clang-format path when invoking aidl-format"ub-automotive-master-20221215
-rw-r--r-- | rh/hooks.py | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/rh/hooks.py b/rh/hooks.py index 0e9ee40..4069b02 100644 --- a/rh/hooks.py +++ b/rh/hooks.py @@ -1030,13 +1030,17 @@ def check_aidl_format(project, commit, _desc, diff, options=None): if not filtered: return None aidl_format = options.tool_path('aidl-format') - cmd = [aidl_format, '-d'] + options.args((), filtered) + clang_format = options.tool_path('clang-format') + diff_cmd = [aidl_format, '-d', '--clang-format-path', clang_format] + \ + options.args((), filtered) ret = [] for d in filtered: data = rh.git.get_file_content(commit, d.file) - result = _run(cmd, input=data) + result = _run(diff_cmd, input=data) if result.stdout: - fixup_func = _fixup_func_caller([aidl_format, '-w', d.file]) + fix_cmd = [aidl_format, '-w', '--clang-format-path', clang_format, + d.file] + fixup_func = _fixup_func_caller(fix_cmd) ret.append(rh.results.HookResult( 'aidl-format', project, commit, error=result.stdout, files=(d.file,), fixup_func=fixup_func)) |