mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-02-20 01:24:42 +04:00
Fixes xargs partition length on Windows for EXE hooks
This commit is contained in:
parent
73848383f2
commit
9da305e185
2 changed files with 2 additions and 2 deletions
|
|
@ -155,7 +155,7 @@ def xargs(
|
||||||
# on windows, batch files have a separate length limit than windows itself
|
# on windows, batch files have a separate length limit than windows itself
|
||||||
if (
|
if (
|
||||||
sys.platform == 'win32' and
|
sys.platform == 'win32' and
|
||||||
cmd[0].lower().endswith(('.bat', '.cmd'))
|
cmd[0].lower().endswith(('.bat', '.cmd', '.exe'))
|
||||||
): # pragma: win32 cover
|
): # pragma: win32 cover
|
||||||
# this is implementation details but the command gets translated into
|
# this is implementation details but the command gets translated into
|
||||||
# full/path/to/cmd.exe /c *cmd
|
# full/path/to/cmd.exe /c *cmd
|
||||||
|
|
|
||||||
|
|
@ -243,7 +243,7 @@ def test_xargs_color_true_makes_tty():
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.xfail(os.name == 'posix', reason='nt only')
|
@pytest.mark.xfail(os.name == 'posix', reason='nt only')
|
||||||
@pytest.mark.parametrize('filename', ('t.bat', 't.cmd', 'T.CMD'))
|
@pytest.mark.parametrize('filename', ('t.bat', 't.cmd', 'T.CMD', 't.exe'))
|
||||||
def test_xargs_with_batch_files(tmpdir, filename):
|
def test_xargs_with_batch_files(tmpdir, filename):
|
||||||
f = tmpdir.join(filename)
|
f = tmpdir.join(filename)
|
||||||
f.write('echo it works\n')
|
f.write('echo it works\n')
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue