diff options
-rw-r--r-- | rh/hooks.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/rh/hooks.py b/rh/hooks.py index 1168720..6cb92a0 100644 --- a/rh/hooks.py +++ b/rh/hooks.py @@ -346,15 +346,17 @@ def check_bpfmt(project, commit, _desc, diff, options=None): bpfmt = options.tool_path('bpfmt') bpfmt_options = options.args((), filtered) - cmd = [bpfmt, '-l'] + bpfmt_options + cmd = [bpfmt, '-d'] + bpfmt_options + fixup_cmd = [bpfmt, '-w'] + if '-s' in bpfmt_options: + fixup_cmd.append('-s') + fixup_cmd.append('--') + ret = [] for d in filtered: data = rh.git.get_file_content(commit, d.file) result = _run(cmd, input=data) if result.stdout: - fixup_cmd = [bpfmt, '-w'] - if '-s' in bpfmt_options: - fixup_cmd.append('-s') ret.append(rh.results.HookResult( 'bpfmt', project, commit, error=result.stdout, |