diff options
| author | Joel Challis <git@zvecr.com> | 2024-08-26 03:56:03 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-08-26 03:56:03 +0100 |
| commit | 7a4f21d34086278cf1484e4e92837260f76b1396 (patch) | |
| tree | 67554fc736c5470adca25d70a90417e13367f04f /lib/python/qmk/cli | |
| parent | 5d76c5280dc0aff398cdce19fa54d0e0725c418d (diff) | |
Reject via keymaps in lint (#24325)
Diffstat (limited to 'lib/python/qmk/cli')
| -rw-r--r-- | lib/python/qmk/cli/lint.py | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/python/qmk/cli/lint.py b/lib/python/qmk/cli/lint.py index ba0c3f274c..efb29704ae 100644 --- a/lib/python/qmk/cli/lint.py +++ b/lib/python/qmk/cli/lint.py | |||
| @@ -14,15 +14,16 @@ from qmk.c_parse import c_source_files | |||
| 14 | 14 | ||
| 15 | CHIBIOS_CONF_CHECKS = ['chconf.h', 'halconf.h', 'mcuconf.h', 'board.h'] | 15 | CHIBIOS_CONF_CHECKS = ['chconf.h', 'halconf.h', 'mcuconf.h', 'board.h'] |
| 16 | INVALID_KB_FEATURES = set(['encoder_map', 'dip_switch_map', 'combo', 'tap_dance', 'via']) | 16 | INVALID_KB_FEATURES = set(['encoder_map', 'dip_switch_map', 'combo', 'tap_dance', 'via']) |
| 17 | INVALID_KM_NAMES = ['via', 'vial'] | ||
| 17 | 18 | ||
| 18 | 19 | ||
| 19 | def _list_defaultish_keymaps(kb): | 20 | def _list_defaultish_keymaps(kb): |
| 20 | """Return default like keymaps for a given keyboard | 21 | """Return default like keymaps for a given keyboard |
| 21 | """ | 22 | """ |
| 22 | defaultish = ['ansi', 'iso', 'via'] | 23 | defaultish = ['ansi', 'iso'] |
| 23 | 24 | ||
| 24 | # This is only here to flag it as "testable", so it doesn't fly under the radar during PR | 25 | # This is only here to flag it as "testable", so it doesn't fly under the radar during PR |
| 25 | defaultish.append('vial') | 26 | defaultish.extend(INVALID_KM_NAMES) |
| 26 | 27 | ||
| 27 | keymaps = set() | 28 | keymaps = set() |
| 28 | for x in list_keymaps(kb): | 29 | for x in list_keymaps(kb): |
| @@ -136,6 +137,11 @@ def keymap_check(kb, km): | |||
| 136 | cli.log.error("%s: Can't find %s keymap.", kb, km) | 137 | cli.log.error("%s: Can't find %s keymap.", kb, km) |
| 137 | return ok | 138 | return ok |
| 138 | 139 | ||
| 140 | if km in INVALID_KM_NAMES: | ||
| 141 | ok = False | ||
| 142 | cli.log.error("%s: The keymap %s should not exist!", kb, km) | ||
| 143 | return ok | ||
| 144 | |||
| 139 | # Additional checks | 145 | # Additional checks |
| 140 | invalid_files = git_get_ignored_files(keymap_path.parent.as_posix()) | 146 | invalid_files = git_get_ignored_files(keymap_path.parent.as_posix()) |
| 141 | for file in invalid_files: | 147 | for file in invalid_files: |
