Reject via keymaps in lint (#24325)

This commit is contained in:
Joel Challis 2024-08-26 03:56:03 +01:00 committed by GitHub
parent 5d76c5280d
commit 7a4f21d340
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -14,15 +14,16 @@ from qmk.c_parse import c_source_files
CHIBIOS_CONF_CHECKS = ['chconf.h', 'halconf.h', 'mcuconf.h', 'board.h'] CHIBIOS_CONF_CHECKS = ['chconf.h', 'halconf.h', 'mcuconf.h', 'board.h']
INVALID_KB_FEATURES = set(['encoder_map', 'dip_switch_map', 'combo', 'tap_dance', 'via']) INVALID_KB_FEATURES = set(['encoder_map', 'dip_switch_map', 'combo', 'tap_dance', 'via'])
INVALID_KM_NAMES = ['via', 'vial']
def _list_defaultish_keymaps(kb): def _list_defaultish_keymaps(kb):
"""Return default like keymaps for a given keyboard """Return default like keymaps for a given keyboard
""" """
defaultish = ['ansi', 'iso', 'via'] defaultish = ['ansi', 'iso']
# This is only here to flag it as "testable", so it doesn't fly under the radar during PR # This is only here to flag it as "testable", so it doesn't fly under the radar during PR
defaultish.append('vial') defaultish.extend(INVALID_KM_NAMES)
keymaps = set() keymaps = set()
for x in list_keymaps(kb): for x in list_keymaps(kb):
@ -136,6 +137,11 @@ def keymap_check(kb, km):
cli.log.error("%s: Can't find %s keymap.", kb, km) cli.log.error("%s: Can't find %s keymap.", kb, km)
return ok return ok
if km in INVALID_KM_NAMES:
ok = False
cli.log.error("%s: The keymap %s should not exist!", kb, km)
return ok
# Additional checks # Additional checks
invalid_files = git_get_ignored_files(keymap_path.parent.as_posix()) invalid_files = git_get_ignored_files(keymap_path.parent.as_posix())
for file in invalid_files: for file in invalid_files: