mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-02-18 08:34:41 +04:00
use_filesnames_file
This commit is contained in:
parent
0252908c27
commit
47d0e05d09
5 changed files with 34 additions and 0 deletions
|
|
@ -7,6 +7,7 @@ import logging
|
|||
import os
|
||||
import re
|
||||
import subprocess
|
||||
import tempfile
|
||||
import time
|
||||
import unicodedata
|
||||
from collections.abc import Generator
|
||||
|
|
@ -187,6 +188,11 @@ 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 = (f"@{filenames_file}",)
|
||||
|
||||
time_before = time.monotonic()
|
||||
language = languages[hook.language]
|
||||
with language.in_env(hook.prefix, hook.language_version):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue