Open ghost opened 1 year ago
I know it's against every styleguide, but black insists on reformatting this function of mine and the result is much worse than if it would just not.
Before:
def run_json_cmd(cmd: Cmd, stderr=stderr) -> Jsonish: from shlex import quote stderr.write(" ".join(("+",) + tuple(quote(arg) for arg in cmd))) stderr.write("\n") from subprocess import check_output output = check_output(cmd) from json import loads return loads(output)
After:
P.S. This is the prelude in both cases, just in case anyone wants it:
from sys import stderr from typing import Union, List, Dict, Tuple Jsonish = Union[ None, int, float, str, bool, List["Jsonish"], Dict[str, "Jsonish"] ] Cmd = tuple[Arg, ...]
I know it's against every styleguide, but black insists on reformatting this function of mine and the result is much worse than if it would just not.
Before:
After:
P.S. This is the prelude in both cases, just in case anyone wants it: