mirror of
https://github.com/qmk/qmk_firmware.git
synced 2025-07-16 21:01:31 +00:00
Exclude external userspace from lint checking (#24680)
This commit is contained in:
parent
6624671a60
commit
e27dd0f26f
@ -26,7 +26,7 @@ def _list_defaultish_keymaps(kb):
|
|||||||
defaultish.extend(INVALID_KM_NAMES)
|
defaultish.extend(INVALID_KM_NAMES)
|
||||||
|
|
||||||
keymaps = set()
|
keymaps = set()
|
||||||
for x in list_keymaps(kb):
|
for x in list_keymaps(kb, include_userspace=False):
|
||||||
if x in defaultish or x.startswith('default'):
|
if x in defaultish or x.startswith('default'):
|
||||||
keymaps.add(x)
|
keymaps.add(x)
|
||||||
|
|
||||||
|
@ -399,7 +399,7 @@ def is_keymap_target(keyboard, keymap):
|
|||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
||||||
def list_keymaps(keyboard, c=True, json=True, additional_files=None, fullpath=False):
|
def list_keymaps(keyboard, c=True, json=True, additional_files=None, fullpath=False, include_userspace=True):
|
||||||
"""List the available keymaps for a keyboard.
|
"""List the available keymaps for a keyboard.
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
@ -418,14 +418,19 @@ def list_keymaps(keyboard, c=True, json=True, additional_files=None, fullpath=Fa
|
|||||||
fullpath
|
fullpath
|
||||||
When set to True the full path of the keymap relative to the `qmk_firmware` root will be provided.
|
When set to True the full path of the keymap relative to the `qmk_firmware` root will be provided.
|
||||||
|
|
||||||
|
include_userspace
|
||||||
|
When set to True, also search userspace for available keymaps
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
a sorted list of valid keymap names.
|
a sorted list of valid keymap names.
|
||||||
"""
|
"""
|
||||||
names = set()
|
names = set()
|
||||||
|
|
||||||
|
has_userspace = HAS_QMK_USERSPACE and include_userspace
|
||||||
|
|
||||||
# walk up the directory tree until keyboards_dir
|
# walk up the directory tree until keyboards_dir
|
||||||
# and collect all directories' name with keymap.c file in it
|
# and collect all directories' name with keymap.c file in it
|
||||||
for search_dir in [QMK_FIRMWARE, QMK_USERSPACE] if HAS_QMK_USERSPACE else [QMK_FIRMWARE]:
|
for search_dir in [QMK_FIRMWARE, QMK_USERSPACE] if has_userspace else [QMK_FIRMWARE]:
|
||||||
keyboards_dir = search_dir / Path('keyboards')
|
keyboards_dir = search_dir / Path('keyboards')
|
||||||
kb_path = keyboards_dir / keyboard
|
kb_path = keyboards_dir / keyboard
|
||||||
|
|
||||||
@ -443,7 +448,7 @@ def list_keymaps(keyboard, c=True, json=True, additional_files=None, fullpath=Fa
|
|||||||
info = info_json(keyboard)
|
info = info_json(keyboard)
|
||||||
|
|
||||||
community_parents = list(Path('layouts').glob('*/'))
|
community_parents = list(Path('layouts').glob('*/'))
|
||||||
if HAS_QMK_USERSPACE and (Path(QMK_USERSPACE) / "layouts").exists():
|
if has_userspace and (Path(QMK_USERSPACE) / "layouts").exists():
|
||||||
community_parents.append(Path(QMK_USERSPACE) / "layouts")
|
community_parents.append(Path(QMK_USERSPACE) / "layouts")
|
||||||
|
|
||||||
for community_parent in community_parents:
|
for community_parent in community_parents:
|
||||||
|
Loading…
Reference in New Issue
Block a user