Browse Source

Prevent `qmk migrate` processing unparsed info.json values (#22374)

pull/22872/head
Joel Challis 4 months ago
committed by GitHub
parent
commit
455cd65e80
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 1 deletions
  1. +4
    -1
      lib/python/qmk/cli/migrate.py
  2. +3
    -0
      lib/python/qmk/info.py

+ 4
- 1
lib/python/qmk/cli/migrate.py View File

@ -47,9 +47,12 @@ def migrate(cli):
files = _candidate_files(cli.args.keyboard)
# Filter down keys if requested
keys = info_map.keys()
keys = list(filter(lambda key: info_map[key].get("to_json", True), info_map.keys()))
if cli.args.filter:
keys = list(set(keys) & set(cli.args.filter))
rejected = set(cli.args.filter) - set(keys)
for key in rejected:
cli.log.info(f'{{fg_yellow}}Skipping {key} as migration not possible...')
cli.log.info(f'{{fg_green}}Migrating keyboard {{fg_cyan}}{cli.args.keyboard}{{fg_green}}.{{fg_reset}}')


+ 3
- 0
lib/python/qmk/info.py View File

@ -501,6 +501,9 @@ def _config_to_json(key_type, config_value):
"""Convert config value using spec
"""
if key_type.startswith('array'):
if key_type.count('.') > 1:
raise Exception(f"Conversion of {key_type} not possible")
if '.' in key_type:
key_type, array_type = key_type.split('.', 1)
else:


Loading…
Cancel
Save