Merge pull request #419 from pre-commit/extra_output

Remove unnecessary double printing of filename
This commit is contained in:
Anthony Sottile 2019-10-12 13:53:50 -07:00 committed by GitHub
commit 0f7b5e0c4f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 1 additions and 9 deletions

View file

@ -120,12 +120,6 @@ def main(argv=None): # type: (Optional[Sequence[str]]) -> int
)
if contents != pretty_contents:
print(
'File {} is not pretty-formatted'.format(json_file),
file=sys.stderr,
)
sys.stderr.flush()
if args.autofix:
_autofix(json_file, pretty_contents)
else:

View file

@ -131,11 +131,9 @@ def test_diffing_output(capsys):
+ "foo": "bar"
}}
'''.format(a, b)
expected_err = 'File {} is not pretty-formatted\n'.format(resource_path)
actual_retval = main([resource_path])
actual_out, actual_err = capsys.readouterr()
assert actual_retval == expected_retval
assert actual_out == expected_out
assert actual_err == expected_err
assert actual_err == ''