Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Flag LAYOUT macros still defined in .h files #23260

Merged
merged 1 commit into from
Mar 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion lib/python/qmk/info.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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']):
Expand Down
Loading