Skip to content

Commit 27cd688

Browse files
committed
Flush stderr, and formatting
1 parent 35c76c4 commit 27cd688

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

pre_commit_hooks/pretty_format_json.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@ def main(argv=None): # type: (Optional[Sequence[str]]) -> int
124124
'File {} is not pretty-formatted'.format(json_file),
125125
file=sys.stderr,
126126
)
127+
sys.stderr.flush()
127128

128129
if args.autofix:
129130
_autofix(json_file, pretty_contents)

tests/pretty_format_json_test.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,8 @@ def test_badfile_main():
110110
def test_diffing_output(capsys):
111111
resource_path = get_resource_path('not_pretty_formatted_json.json')
112112
expected_retval = 1
113-
expected_out = ''' {
113+
expected_out = '''\
114+
{
114115
- "foo":
115116
- "bar",
116117
- "alist": [2, 34, 234],

0 commit comments

Comments
 (0)