Format DD mappings and schemas (#18924)
This commit is contained in:
parent
ce80a3ad46
commit
479d8de622
14 changed files with 1290 additions and 1320 deletions
|
@ -98,7 +98,7 @@ def generate_api(cli):
|
|||
|
||||
# Generate data for the global files
|
||||
keyboard_list = sorted(kb_all)
|
||||
keyboard_aliases = json_load(Path('data/mappings/keyboard_aliases.json'))
|
||||
keyboard_aliases = json_load(Path('data/mappings/keyboard_aliases.hjson'))
|
||||
keyboard_metadata = {
|
||||
'last_updated': current_datetime(),
|
||||
'keyboards': keyboard_list,
|
||||
|
|
|
@ -70,7 +70,7 @@ def generate_matrix_size(kb_info_json, config_h_lines):
|
|||
def generate_config_items(kb_info_json, config_h_lines):
|
||||
"""Iterate through the info_config map to generate basic config values.
|
||||
"""
|
||||
info_config_map = json_load(Path('data/mappings/info_config.json'))
|
||||
info_config_map = json_load(Path('data/mappings/info_config.hjson'))
|
||||
|
||||
for config_key, info_dict in info_config_map.items():
|
||||
info_key = info_dict['info_key']
|
||||
|
|
|
@ -62,7 +62,7 @@ def generate_rules_mk(cli):
|
|||
cli.subcommands['generate-rules-mk'].print_help()
|
||||
return False
|
||||
|
||||
info_rules_map = json_load(Path('data/mappings/info_rules.json'))
|
||||
info_rules_map = json_load(Path('data/mappings/info_rules.hjson'))
|
||||
rules_mk_lines = [GPL2_HEADER_SH_LIKE, GENERATED_HEADER_SH_LIKE]
|
||||
|
||||
# Iterate through the info_rules map to generate basic rules
|
||||
|
|
|
@ -210,7 +210,7 @@ def new_keyboard(cli):
|
|||
|
||||
# Preprocess any development_board presets
|
||||
if mcu in dev_boards:
|
||||
defaults_map = json_load(Path('data/mappings/defaults.json'))
|
||||
defaults_map = json_load(Path('data/mappings/defaults.hjson'))
|
||||
board = defaults_map['development_board'][mcu]
|
||||
|
||||
mcu = board['processor']
|
||||
|
|
|
@ -214,7 +214,7 @@ def parse_configurator_json(configurator_file):
|
|||
exit(1)
|
||||
|
||||
orig_keyboard = user_keymap['keyboard']
|
||||
aliases = json_load(Path('data/mappings/keyboard_aliases.json'))
|
||||
aliases = json_load(Path('data/mappings/keyboard_aliases.hjson'))
|
||||
|
||||
if orig_keyboard in aliases:
|
||||
if 'target' in aliases[orig_keyboard]:
|
||||
|
|
|
@ -483,7 +483,7 @@ def _extract_config_h(info_data, config_c):
|
|||
"""
|
||||
# Pull in data from the json map
|
||||
dotty_info = dotty(info_data)
|
||||
info_config_map = json_load(Path('data/mappings/info_config.json'))
|
||||
info_config_map = json_load(Path('data/mappings/info_config.hjson'))
|
||||
|
||||
for config_key, info_dict in info_config_map.items():
|
||||
info_key = info_dict['info_key']
|
||||
|
@ -529,7 +529,7 @@ def _extract_config_h(info_data, config_c):
|
|||
def _process_defaults(info_data):
|
||||
"""Process any additional defaults based on currently discovered information
|
||||
"""
|
||||
defaults_map = json_load(Path('data/mappings/defaults.json'))
|
||||
defaults_map = json_load(Path('data/mappings/defaults.hjson'))
|
||||
for default_type in defaults_map.keys():
|
||||
thing_map = defaults_map[default_type]
|
||||
if default_type in info_data:
|
||||
|
@ -555,7 +555,7 @@ def _extract_rules_mk(info_data, rules):
|
|||
|
||||
# Pull in data from the json map
|
||||
dotty_info = dotty(info_data)
|
||||
info_rules_map = json_load(Path('data/mappings/info_rules.json'))
|
||||
info_rules_map = json_load(Path('data/mappings/info_rules.hjson'))
|
||||
|
||||
for rules_key, info_dict in info_rules_map.items():
|
||||
info_key = info_dict['info_key']
|
||||
|
|
|
@ -69,7 +69,7 @@ def keyboard_folder(keyboard):
|
|||
|
||||
This checks aliases and DEFAULT_FOLDER to resolve the actual path for a keyboard.
|
||||
"""
|
||||
aliases = json_load(Path('data/mappings/keyboard_aliases.json'))
|
||||
aliases = json_load(Path('data/mappings/keyboard_aliases.hjson'))
|
||||
|
||||
if keyboard in aliases:
|
||||
keyboard = aliases[keyboard].get('target', keyboard)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue