diff --git a/pre_commit/commands/run.py b/pre_commit/commands/run.py index 8d99f3aa..22827b7a 100644 --- a/pre_commit/commands/run.py +++ b/pre_commit/commands/run.py @@ -189,8 +189,8 @@ def _run_single_hook( if not hook.pass_filenames: filenames = () elif hook.use_filesnames_file: - filenames_file = tempfile.NamedTemporaryFile("w+") - filenames_file.write("\n".join(filenames)) + filenames_file = tempfile.NamedTemporaryFile('w+') + filenames_file.write('\n'.join(filenames)) filenames = (f"@{filenames_file}",) time_before = time.monotonic() diff --git a/tests/commands/run_test.py b/tests/commands/run_test.py index 676d5fb5..91b104e6 100644 --- a/tests/commands/run_test.py +++ b/tests/commands/run_test.py @@ -1085,8 +1085,8 @@ def test_use_filesnames_file( cap_out, store, repo_with_passing_hook, run_opts(verbose=True), ) out_lines = printed.splitlines() - out_lines[-1] == b"Hello World" - assert out_lines[-2].startswith(b"@") == use_filesnames_file + out_lines[-1] == b'Hello World' + assert out_lines[-2].startswith(b'@') == use_filesnames_file def test_fail_fast(cap_out, store, repo_with_failing_hook):