aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@google.com>2023-06-09 10:59:58 -0400
committerMike Frysinger <vapier@google.com>2023-06-09 23:11:39 +0000
commitd074a2949f95daaa5c70da8b38ad3177d56087c5 (patch)
tree535e0493b9c50ce9e0aff99f24cabb7402d7587d
parentdca21d9487a4392dde2ad95a04b461a5cb4b60ea (diff)
downloadrepohooks-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-xpre-upload.py2
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():