summaryrefslogtreecommitdiff
path: root/lib/python/qmk/info.py
diff options
context:
space:
mode:
authorJoel Challis <git@zvecr.com>2023-03-27 20:01:07 +0100
committerGitHub <noreply@github.com>2023-03-27 20:01:07 +0100
commit79b0f9168eafef1642f3223500197bf630a2433f (patch)
treef73f4b61d1e635f7aac380c99bf98571e1eeb2f9 /lib/python/qmk/info.py
parente35bb8ebfad8b8ce40de98e9607fb6dbf8d8fff4 (diff)
Custom keycodes in JSON (#19925)
Diffstat (limited to 'lib/python/qmk/info.py')
-rw-r--r--lib/python/qmk/info.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/python/qmk/info.py b/lib/python/qmk/info.py
index b7ee055eef..f4dcc507ef 100644
--- a/lib/python/qmk/info.py
+++ b/lib/python/qmk/info.py
@@ -103,6 +103,12 @@ def _validate(keyboard, info_data):
if layout_name not in layouts and layout_name not in layout_aliases:
_log_error(info_data, 'Claims to support community layout %s but no %s() macro found' % (layout, layout_name))
+ # keycodes with length > 7 must have short forms for visualisation purposes
+ for decl in info_data.get('keycodes', []):
+ if len(decl["key"]) > 7:
+ if not decl.get("aliases", []):
+ _log_error(info_data, f'Keycode {decl["key"]} has no short form alias')
+
def info_json(keyboard):
"""Generate the info.json data for a specific keyboard.