We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 15d9beb commit 757f474Copy full SHA for 757f474
pre_commit_hooks/pretty_format_json.py
@@ -141,16 +141,19 @@ def main(argv: Sequence[str] | None = None) -> int:
141
if args.autofix:
142
_autofix(json_file, pretty_contents)
143
if args.empty_object_with_newline:
144
+ # When using --empty-object-with-newline with --autofix,
145
+ # we want to return success after fixing
146
status = 0
147
+ else:
148
+ status = 1
149
else:
150
diff_output = get_diff(
151
contents,
152
pretty_contents,
153
json_file
154
)
155
sys.stdout.buffer.write(diff_output.encode())
-
- status = 1
156
157
158
return status
159
0 commit comments