aboutsummaryrefslogtreecommitdiff
path: root/lib/python/qmk/cli/lint.py
diff options
context:
space:
mode:
authorNick Brassel <[email protected]>2024-02-28 21:47:37 +1100
committerNick Brassel <[email protected]>2024-02-28 21:47:37 +1100
commit4e369d405af6bba1adce6337b2e1b1ea1788566c (patch)
treeb0f020feff1809e37c9e7795d344929ff0bb290a /lib/python/qmk/cli/lint.py
parent4e04da397ef643f8fcf4afbe1d19f63aee1fc561 (diff)
parentdd1706e468bb18dd7f7ae143de735a5d3be1bfb8 (diff)
downloadqmk_firmware-4e369d405af6bba1adce6337b2e1b1ea1788566c.tar.gz
qmk_firmware-4e369d405af6bba1adce6337b2e1b1ea1788566c.zip
Merge branch 'develop'0.24.0
Diffstat (limited to 'lib/python/qmk/cli/lint.py')
-rw-r--r--lib/python/qmk/cli/lint.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/python/qmk/cli/lint.py b/lib/python/qmk/cli/lint.py
index a7c85b5643..7ebb0cf9c4 100644
--- a/lib/python/qmk/cli/lint.py
+++ b/lib/python/qmk/cli/lint.py
@@ -13,6 +13,7 @@ from qmk.git import git_get_ignored_files
from qmk.c_parse import c_source_files
CHIBIOS_CONF_CHECKS = ['chconf.h', 'halconf.h', 'mcuconf.h', 'board.h']
+INVALID_KB_FEATURES = set(['encoder_map', 'dip_switch_map', 'combo', 'tap_dance', 'via'])
def _list_defaultish_keymaps(kb):
@@ -69,6 +70,17 @@ def _handle_json_errors(kb, info):
return ok
+def _handle_invalid_features(kb, info):
+ """Check for features that should never be enabled at the keyboard level
+ """
+ ok = True
+ features = set(info.get('features', []))
+ for found in features & INVALID_KB_FEATURES:
+ ok = False
+ cli.log.error(f'{kb}: Invalid keyboard level feature detected - {found}')
+ return ok
+
+
def _chibios_conf_includenext_check(target):
"""Check the ChibiOS conf.h for the correct inclusion of the next conf.h
"""
@@ -154,6 +166,9 @@ def keyboard_check(kb):
ok = False
# Additional checks
+ if not _handle_invalid_features(kb, kb_info):
+ ok = False
+
rules_mk_assignment_errors = _rules_mk_assignment_only(kb)
if rules_mk_assignment_errors:
ok = False