diff options
author | Mike Frysinger <vapier@google.com> | 2023-06-09 10:59:58 -0400 |
---|---|---|
committer | Mike Frysinger <vapier@google.com> | 2023-06-09 23:11:39 +0000 |
commit | d074a2949f95daaa5c70da8b38ad3177d56087c5 (patch) | |
tree | 535e0493b9c50ce9e0aff99f24cabb7402d7587d | |
parent | dca21d9487a4392dde2ad95a04b461a5cb4b60ea (diff) | |
download | repohooks-d074a2949f95daaa5c70da8b38ad3177d56087c5.tar.gz |
pre-upload: fix & improve display of files
In a refactor long long ago, this line was switched from a print (which
adds a newline to the end) to a string concat, but the newline was lost
which has caused the error display to be smooshed together.
Also pass the contents through rh.shell.cmd_to_str to get more natural
output & quoting so people can copy & paste into a shell rather than
the Python stringify output for lists/tuples.
Bug: None
Test: uploaded a CL with formatting errors
Change-Id: I02acbb39acf5cf09274897086c107170c4fc8554
-rwxr-xr-x | pre-upload.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/pre-upload.py b/pre-upload.py index f58f058..087dd31 100755 --- a/pre-upload.py +++ b/pre-upload.py @@ -185,7 +185,7 @@ def _process_hook_results(results): if result: ret = '' if result.files: - ret += f' FILES: {result.files}' + ret += f' FILES: {rh.shell.cmd_to_str(result.files)}\n' lines = result.error.splitlines() ret += '\n'.join(f' {x}' for x in lines) if result.is_warning(): |