1
0
Fork 0

New command: qmk lint (#10761)

* Basic qmk lint command

* check for keymap readme

* change the workflow from qmk info to qmk lint

* add a strict mode

* parsing -> parse

* document qmk lint

* small info logging cleanup

* Apply suggestions from code review

Co-authored-by: Ryan <fauxpark@gmail.com>

* honor --strict in more places

* change the job name to lint

Co-authored-by: Ryan <fauxpark@gmail.com>
This commit is contained in:
Zach White 2020-11-07 09:56:08 -08:00 committed by GitHub
parent 7ce5402417
commit 4d33d72975
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 153 additions and 24 deletions

View file

@ -28,15 +28,21 @@ def under_qmk_firmware():
return None
def keymap(keyboard):
def keyboard(keyboard_name):
"""Returns the path to a keyboard's directory relative to the qmk root.
"""
return Path('keyboards') / keyboard_name
def keymap(keyboard_name):
"""Locate the correct directory for storing a keymap.
Args:
keyboard
keyboard_name
The name of the keyboard. Example: clueboard/66/rev3
"""
keyboard_folder = Path('keyboards') / keyboard
keyboard_folder = keyboard(keyboard_name)
for i in range(MAX_KEYBOARD_SUBFOLDERS):
if (keyboard_folder / 'keymaps').exists():
@ -45,7 +51,7 @@ def keymap(keyboard):
keyboard_folder = keyboard_folder.parent
logging.error('Could not find the keymaps directory!')
raise NoSuchKeyboardError('Could not find keymaps directory for: %s' % keyboard)
raise NoSuchKeyboardError('Could not find keymaps directory for: %s' % keyboard_name)
def normpath(path):