diff --git a/pre_commit/xargs.py b/pre_commit/xargs.py index 22580f59..3bea9858 100644 --- a/pre_commit/xargs.py +++ b/pre_commit/xargs.py @@ -155,7 +155,7 @@ def xargs( # on windows, batch files have a separate length limit than windows itself if ( sys.platform == 'win32' and - cmd[0].lower().endswith(('.bat', '.cmd')) + cmd[0].lower().endswith(('.bat', '.cmd', '.exe')) ): # pragma: win32 cover # this is implementation details but the command gets translated into # full/path/to/cmd.exe /c *cmd diff --git a/tests/xargs_test.py b/tests/xargs_test.py index e8000b25..c76153c1 100644 --- a/tests/xargs_test.py +++ b/tests/xargs_test.py @@ -243,7 +243,7 @@ def test_xargs_color_true_makes_tty(): @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): f = tmpdir.join(filename) f.write('echo it works\n')