Browse Source

Flag LAYOUT macros still defined in .h files (#23260)

pull/23015/head
Joel Challis 1 month ago
committed by GitHub
parent
commit
ae38bdd5dc
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
1 changed files with 6 additions and 1 deletions
  1. +6
    -1
      lib/python/qmk/info.py

+ 6
- 1
lib/python/qmk/info.py View File

@ -78,7 +78,7 @@ def _find_invalid_encoder_index(info_data):
return ret
def _validate_layouts(keyboard, info_data):
def _validate_layouts(keyboard, info_data): # noqa C901
"""Non schema checks
"""
col_num = info_data.get('matrix_size', {}).get('cols', 0)
@ -92,6 +92,11 @@ def _validate_layouts(keyboard, info_data):
if len(layouts) == 0 or all(not layout.get('json_layout', False) for layout in layouts.values()):
_log_error(info_data, 'No LAYOUTs defined! Need at least one layout defined in info.json.')
# Make sure all layouts are DD
for layout_name, layout_data in layouts.items():
if layout_data.get('c_macro', False):
_log_error(info_data, f'{layout_name}: Layout macro should not be defined within ".h" files.')
# Make sure all matrix values are in bounds
for layout_name, layout_data in layouts.items():
for index, key_data in enumerate(layout_data['layout']):


Loading…
Cancel
Save