mirror of
https://github.com/pre-commit/pre-commit-hooks.git
synced 2026-04-09 12:54:17 +00:00
Merge pull request #419 from pre-commit/extra_output
Remove unnecessary double printing of filename
This commit is contained in:
commit
0f7b5e0c4f
2 changed files with 1 additions and 9 deletions
|
|
@ -120,12 +120,6 @@ def main(argv=None): # type: (Optional[Sequence[str]]) -> int
|
||||||
)
|
)
|
||||||
|
|
||||||
if contents != pretty_contents:
|
if contents != pretty_contents:
|
||||||
print(
|
|
||||||
'File {} is not pretty-formatted'.format(json_file),
|
|
||||||
file=sys.stderr,
|
|
||||||
)
|
|
||||||
sys.stderr.flush()
|
|
||||||
|
|
||||||
if args.autofix:
|
if args.autofix:
|
||||||
_autofix(json_file, pretty_contents)
|
_autofix(json_file, pretty_contents)
|
||||||
else:
|
else:
|
||||||
|
|
|
||||||
|
|
@ -131,11 +131,9 @@ def test_diffing_output(capsys):
|
||||||
+ "foo": "bar"
|
+ "foo": "bar"
|
||||||
}}
|
}}
|
||||||
'''.format(a, b)
|
'''.format(a, b)
|
||||||
expected_err = 'File {} is not pretty-formatted\n'.format(resource_path)
|
|
||||||
|
|
||||||
actual_retval = main([resource_path])
|
actual_retval = main([resource_path])
|
||||||
actual_out, actual_err = capsys.readouterr()
|
actual_out, actual_err = capsys.readouterr()
|
||||||
|
|
||||||
assert actual_retval == expected_retval
|
assert actual_retval == expected_retval
|
||||||
assert actual_out == expected_out
|
assert actual_out == expected_out
|
||||||
assert actual_err == expected_err
|
assert actual_err == ''
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue