aboutsummaryrefslogtreecommitdiff
path: root/toolchain_utils_githooks/check-presubmit.py
diff options
context:
space:
mode:
Diffstat (limited to 'toolchain_utils_githooks/check-presubmit.py')
-rwxr-xr-xtoolchain_utils_githooks/check-presubmit.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/toolchain_utils_githooks/check-presubmit.py b/toolchain_utils_githooks/check-presubmit.py
index 29744aaf..485737d5 100755
--- a/toolchain_utils_githooks/check-presubmit.py
+++ b/toolchain_utils_githooks/check-presubmit.py
@@ -187,7 +187,8 @@ def check_black(
)
black_version = stdout_and_stderr.strip()
- command = [black, "--line-length=80", "--check"] + python_files
+ black_invocation: t.List[str] = [str(black), "--line-length=80"]
+ command = black_invocation + ["--check"] + list(python_files)
exit_code, stdout_and_stderr = run_command_unchecked(
command, cwd=toolchain_utils_root
)
@@ -238,7 +239,7 @@ def check_black(
autofix_commands=[],
)
- autofix = [black] + bad_files
+ autofix = black_invocation + bad_files
return CheckResult(
ok=False,
output=f"Using {black_version!r}, these file(s) have formatting errors: "