mirror of
https://github.com/pre-commit/pre-commit-hooks.git
synced 2026-04-10 05:14:18 +00:00
fixed test failure
This commit is contained in:
parent
15d9beba94
commit
757f47498b
1 changed files with 5 additions and 2 deletions
|
|
@ -141,7 +141,11 @@ def main(argv: Sequence[str] | None = None) -> int:
|
||||||
if args.autofix:
|
if args.autofix:
|
||||||
_autofix(json_file, pretty_contents)
|
_autofix(json_file, pretty_contents)
|
||||||
if args.empty_object_with_newline:
|
if args.empty_object_with_newline:
|
||||||
|
# When using --empty-object-with-newline with --autofix,
|
||||||
|
# we want to return success after fixing
|
||||||
status = 0
|
status = 0
|
||||||
|
else:
|
||||||
|
status = 1
|
||||||
else:
|
else:
|
||||||
diff_output = get_diff(
|
diff_output = get_diff(
|
||||||
contents,
|
contents,
|
||||||
|
|
@ -149,7 +153,6 @@ def main(argv: Sequence[str] | None = None) -> int:
|
||||||
json_file
|
json_file
|
||||||
)
|
)
|
||||||
sys.stdout.buffer.write(diff_output.encode())
|
sys.stdout.buffer.write(diff_output.encode())
|
||||||
|
|
||||||
status = 1
|
status = 1
|
||||||
|
|
||||||
return status
|
return status
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue