Skip to content

Commit 0f7b5e0

Browse files
authored
Merge pull request #419 from pre-commit/extra_output
Remove unnecessary double printing of filename
2 parents 49f8b48 + 86a010b commit 0f7b5e0

File tree

2 files changed

+1
-9
lines changed

2 files changed

+1
-9
lines changed

pre_commit_hooks/pretty_format_json.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -120,12 +120,6 @@ def main(argv=None): # type: (Optional[Sequence[str]]) -> int
120120
)
121121

122122
if contents != pretty_contents:
123-
print(
124-
'File {} is not pretty-formatted'.format(json_file),
125-
file=sys.stderr,
126-
)
127-
sys.stderr.flush()
128-
129123
if args.autofix:
130124
_autofix(json_file, pretty_contents)
131125
else:

tests/pretty_format_json_test.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -131,11 +131,9 @@ def test_diffing_output(capsys):
131131
+ "foo": "bar"
132132
}}
133133
'''.format(a, b)
134-
expected_err = 'File {} is not pretty-formatted\n'.format(resource_path)
135-
136134
actual_retval = main([resource_path])
137135
actual_out, actual_err = capsys.readouterr()
138136

139137
assert actual_retval == expected_retval
140138
assert actual_out == expected_out
141-
assert actual_err == expected_err
139+
assert actual_err == ''

0 commit comments

Comments
 (0)