Skip to content

Commit 01ea2a6

Browse files
committed
fix: pretty print the compile commands for orjson
1 parent 15db2a2 commit 01ea2a6

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

refresh.template.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -1065,10 +1065,11 @@ def _write_compile_commands(compile_command_entries: typing.List[str]):
10651065
file_name = 'compile_commands.json'
10661066
try:
10671067
# orjson is much faster than the standard library's json module (1.9 seconds vs 6.6 seconds for a ~140 MB file).
1068-
from orjson import dumps
1068+
from orjson import dumps, OPT_INDENT_2
10691069
with open(file_name, 'wb') as output_file:
10701070
output_file.write(dumps(
10711071
compile_command_entries,
1072+
option=OPT_INDENT_2
10721073
))
10731074
except ImportError:
10741075
with open(file_name, 'w') as output_file:

0 commit comments

Comments
 (0)