From 6d90fa2300b463f5cc6920022a445d5ed217124c Mon Sep 17 00:00:00 2001 From: Ryan Date: Sat, 20 May 2023 22:15:05 +1000 Subject: `qmk format-json`: Expose full key path and respect `sort_keys` (#20836) --- lib/python/qmk/importers.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib/python/qmk/importers.py') diff --git a/lib/python/qmk/importers.py b/lib/python/qmk/importers.py index edc1f940da..8c449a7194 100644 --- a/lib/python/qmk/importers.py +++ b/lib/python/qmk/importers.py @@ -91,7 +91,7 @@ def import_keymap(keymap_data): keyboard_keymap.parent.mkdir(parents=True, exist_ok=True) # Dump out all those lovely files - keyboard_keymap.write_text(json.dumps(keymap_data, cls=KeymapJSONEncoder)) + keyboard_keymap.write_text(json.dumps(keymap_data, cls=KeymapJSONEncoder, sort_keys=True)) return (kb_name, km_name) @@ -139,8 +139,8 @@ def import_keyboard(info_data, keymap_data=None): temp = json_load(keyboard_info) deep_update(temp, info_data) - keyboard_info.write_text(json.dumps(temp, cls=InfoJSONEncoder)) - keyboard_keymap.write_text(json.dumps(keymap_data, cls=KeymapJSONEncoder)) + keyboard_info.write_text(json.dumps(temp, cls=InfoJSONEncoder, sort_keys=True)) + keyboard_keymap.write_text(json.dumps(keymap_data, cls=KeymapJSONEncoder, sort_keys=True)) return kb_name -- cgit v1.2.3