mirror of
https://github.com/pre-commit/pre-commit-hooks.git
synced 2026-03-13 07:41:19 +08:00
Flush stderr, and formatting
This commit is contained in:
@@ -124,6 +124,7 @@ def main(argv=None): # type: (Optional[Sequence[str]]) -> int
|
||||
'File {} is not pretty-formatted'.format(json_file),
|
||||
file=sys.stderr,
|
||||
)
|
||||
sys.stderr.flush()
|
||||
|
||||
if args.autofix:
|
||||
_autofix(json_file, pretty_contents)
|
||||
|
||||
@@ -110,7 +110,8 @@ def test_badfile_main():
|
||||
def test_diffing_output(capsys):
|
||||
resource_path = get_resource_path('not_pretty_formatted_json.json')
|
||||
expected_retval = 1
|
||||
expected_out = ''' {
|
||||
expected_out = '''\
|
||||
{
|
||||
- "foo":
|
||||
- "bar",
|
||||
- "alist": [2, 34, 234],
|
||||
|
||||
Reference in New Issue
Block a user