1
0
Fork 0

qmk format-json: Expose full key path and respect sort_keys (#20836)

This commit is contained in:
Ryan 2023-05-20 22:15:05 +10:00 committed by GitHub
parent 102c42b14b
commit 6d90fa2300
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 48 additions and 52 deletions

View file

@ -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