Skip to content

Commit fa9db4e

Browse files
committed
Fix terminal width detection.
1 parent 06830ab commit fa9db4e

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
- id: trailing-whitespace
55
- id: end-of-file-fixer
66
- id: autopep8-wrapper
7-
args: ['-i', '--ignore=E265,E309,E501', '-v']
7+
args: ['-i', '--ignore=E265,E309,E501']
88
- id: check-json
99
- id: check-yaml
1010
- id: debug-statements

pre_commit/output.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
from __future__ import unicode_literals
22

3-
import os
43
import subprocess
54
import sys
65

@@ -11,7 +10,7 @@
1110
# TODO: smell: import side-effects
1211
COLS = int(
1312
subprocess.Popen(
14-
['tput', 'cols'], stdout=subprocess.PIPE, stderr=open(os.devnull, 'w'),
13+
['tput', 'cols'], stdout=subprocess.PIPE,
1514
).communicate()[0] or
1615
# Default in the case of no terminal
1716
80

tests/commands/install_uninstall_test.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,10 @@ def test_installed_from_venv(tmpdir_factory):
382382
# Should still pick up the python from when we installed
383383
ret, output = _get_commit_output(
384384
tmpdir_factory,
385-
env_base={'HOME': os.environ['HOME']},
385+
env_base={
386+
'HOME': os.environ['HOME'],
387+
'TERM': os.environ.get('TERM', ''),
388+
},
386389
)
387390
assert ret == 0
388391
assert NORMAL_PRE_COMMIT_RUN.match(output)

0 commit comments

Comments
 (0)