mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-02-17 00:04:42 +04:00
Make verbose output less special
This commit is contained in:
parent
74fd04c67e
commit
01a628d96d
8 changed files with 99 additions and 108 deletions
|
|
@ -135,17 +135,9 @@ def xargs(cmd, varargs, **kwargs):
|
|||
results = thread_map(run_cmd_partition, partitions)
|
||||
|
||||
for proc_retcode, proc_out, _ in results:
|
||||
# This is *slightly* too clever so I'll explain it.
|
||||
# First the xor boolean table:
|
||||
# T | F |
|
||||
# +-------+
|
||||
# T | F | T |
|
||||
# --+-------+
|
||||
# F | T | F |
|
||||
# --+-------+
|
||||
# When negate is True, it has the effect of flipping the return
|
||||
# code. Otherwise, the returncode is unchanged.
|
||||
retcode |= bool(proc_retcode) ^ negate
|
||||
if negate:
|
||||
proc_retcode = not proc_retcode
|
||||
retcode = max(retcode, proc_retcode)
|
||||
stdout += proc_out
|
||||
|
||||
return retcode, stdout
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue