Skip to content

Commit e17084e

Browse files
use print([...], file=f) in schema generator to avoid need for precommit end of file fix on regeneration
1 parent 40f1148 commit e17084e

File tree

1 file changed

+2
-2
lines changed
  • src/geophires_x_schema_generator

1 file changed

+2
-2
lines changed

src/geophires_x_schema_generator/main.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,13 @@ def build(json_file_name_prefix: str, generator: GeophiresXSchemaGenerator, rst_
2323

2424
request_build_path = Path(build_dir, f'{json_file_name_prefix}request.json')
2525
with open(request_build_path, 'w') as f:
26-
f.write(json.dumps(request_schema_json, indent=2))
26+
print(json.dumps(request_schema_json, indent=2), file=f)
2727
print(f'Wrote request JSON schema file to {request_build_path}.')
2828

2929
if result_schema_json is not None:
3030
result_build_path = Path(build_dir, f'{json_file_name_prefix}result.json')
3131
with open(result_build_path, 'w') as f:
32-
f.write(json.dumps(result_schema_json, indent=2))
32+
print(json.dumps(result_schema_json, indent=2), file=f)
3333
print(f'Wrote result JSON schema file to {result_build_path}.')
3434

3535
rst = generator.generate_parameters_reference_rst()

0 commit comments

Comments
 (0)