diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/python/qmk/cli/lint.py | 7 | ||||
-rw-r--r-- | lib/python/qmk/info.py | 17 |
2 files changed, 5 insertions, 19 deletions
diff --git a/lib/python/qmk/cli/lint.py b/lib/python/qmk/cli/lint.py index af057b4110..96593ed69b 100644 --- a/lib/python/qmk/cli/lint.py +++ b/lib/python/qmk/cli/lint.py @@ -116,13 +116,6 @@ def lint(cli): if not keymap_check(kb, cli.config.lint.keymap): ok = False - # Check if all non-data driven macros exist in <keyboard.h> - for layout, data in keyboard_info['layouts'].items(): - # Matrix data should be a list with exactly two integers: [0, 1] - if not data['c_macro'] and not all('matrix' in key_data.keys() or len(key_data) == 2 or all(isinstance(n, int) for n in key_data) for key_data in data['layout']): - cli.log.error(f'{kb}: "{layout}" has no "matrix" definition in either "info.json" or "<keyboard>.h"!') - ok = False - # Report status if not ok: failed.append(kb) diff --git a/lib/python/qmk/info.py b/lib/python/qmk/info.py index 6ff9cba45b..23761d71b7 100644 --- a/lib/python/qmk/info.py +++ b/lib/python/qmk/info.py @@ -26,13 +26,6 @@ def _valid_community_layout(layout): return (Path('layouts/default') / layout).exists() -def _remove_newlines_from_labels(layouts): - for layout_name, layout_json in layouts.items(): - for key in layout_json['layout']: - if '\n' in key['label']: - key['label'] = key['label'].split('\n')[0] - - def info_json(keyboard): """Generate the info.json data for a specific keyboard. """ @@ -111,9 +104,6 @@ def info_json(keyboard): # Check that the reported matrix size is consistent with the actual matrix size _check_matrix(info_data) - # Remove newline characters from layout labels - _remove_newlines_from_labels(layouts) - return info_data @@ -807,8 +797,11 @@ def merge_info_jsons(keyboard, info_data): for new_key, existing_key in zip(layout['layout'], info_data['layouts'][layout_name]['layout']): existing_key.update(new_key) else: - layout['c_macro'] = False - info_data['layouts'][layout_name] = layout + if not all('matrix' in key_data.keys() for key_data in layout['layout']): + _log_error(info_data, f'Layout "{layout_name}" has no "matrix" definition in either "info.json" or "<keyboard>.h"!') + else: + layout['c_macro'] = False + info_data['layouts'][layout_name] = layout # Update info_data with the new data if 'layouts' in new_info_data: |