Skip to content

Commit

Permalink
Reject via keymaps in lint (qmk#24325)
Browse files Browse the repository at this point in the history
  • Loading branch information
zvecr committed Aug 26, 2024
1 parent 5d76c52 commit 7a4f21d
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions lib/python/qmk/cli/lint.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,16 @@

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_KM_NAMES = ['via', 'vial']


def _list_defaultish_keymaps(kb):
"""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
defaultish.append('vial')
defaultish.extend(INVALID_KM_NAMES)

keymaps = set()
for x in list_keymaps(kb):
Expand Down Expand Up @@ -136,6 +137,11 @@ def keymap_check(kb, km):
cli.log.error("%s: Can't find %s keymap.", kb, km)
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
invalid_files = git_get_ignored_files(keymap_path.parent.as_posix())
for file in invalid_files:
Expand Down

0 comments on commit 7a4f21d

Please sign in to comment.