Skip to content

Commit 6fabc33

Browse files
authored
Check all keys have matrix positions when parsing C LAYOUT macros (qmk#19781)
1 parent 80c6fba commit 6fabc33

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/python/qmk/c_parse.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,9 @@ def find_layouts(file):
8888
for i, key in enumerate(parsed_layout):
8989
if 'label' not in key:
9090
cli.log.error('Invalid LAYOUT macro in %s: Empty parameter name in macro %s at pos %s.', file, macro_name, i)
91-
elif key['label'] in matrix_locations:
91+
elif key['label'] not in matrix_locations:
92+
cli.log.error('Invalid LAYOUT macro in %s: Key %s in macro %s has no matrix position!', file, key['label'], macro_name)
93+
else:
9294
key['matrix'] = matrix_locations[key['label']]
9395

9496
parsed_layouts[macro_name] = {

0 commit comments

Comments
 (0)