Skip to content

Commit

Permalink
Check all keys have matrix positions when parsing C LAYOUT macros (qm…
Browse files Browse the repository at this point in the history
  • Loading branch information
fauxpark authored Mar 1, 2023
1 parent 80c6fba commit 6fabc33
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/python/qmk/c_parse.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,9 @@ def find_layouts(file):
for i, key in enumerate(parsed_layout):
if 'label' not in key:
cli.log.error('Invalid LAYOUT macro in %s: Empty parameter name in macro %s at pos %s.', file, macro_name, i)
elif key['label'] in matrix_locations:
elif key['label'] not in matrix_locations:
cli.log.error('Invalid LAYOUT macro in %s: Key %s in macro %s has no matrix position!', file, key['label'], macro_name)
else:
key['matrix'] = matrix_locations[key['label']]

parsed_layouts[macro_name] = {
Expand Down

0 comments on commit 6fabc33

Please sign in to comment.