diff options
author | Zach White <skullydazed@gmail.com> | 2021-09-27 10:02:54 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-09-27 10:02:54 -0700 |
commit | fce9cb933845bf0b74d322eba02de3b76daaeb84 (patch) | |
tree | a28ffc6f3c53a4ddf1004f1a99938e2e5a42e6c3 /lib/python/qmk/cli/doctor | |
parent | 5f38a98fa07677be960b71b8e3b0a1785effe0d8 (diff) |
Cleanup issues identified by lgtm (#14459)
* cleanup issues identified by lgtm
* fix the git_status check
Diffstat (limited to 'lib/python/qmk/cli/doctor')
-rw-r--r-- | lib/python/qmk/cli/doctor/linux.py | 8 | ||||
-rwxr-xr-x | lib/python/qmk/cli/doctor/main.py | 9 |
2 files changed, 8 insertions, 9 deletions
diff --git a/lib/python/qmk/cli/doctor/linux.py b/lib/python/qmk/cli/doctor/linux.py index 6ce00f6ef1..94683d3307 100644 --- a/lib/python/qmk/cli/doctor/linux.py +++ b/lib/python/qmk/cli/doctor/linux.py @@ -118,10 +118,9 @@ def check_udev_rules(): cli.log.warning("{fg_yellow}Found old, deprecated udev rules for '%s' boards. The new rules on https://docs.qmk.fm/#/faq_build?id=linux-udev-rules offer better security with the same functionality.", bootloader) else: # For caterina, check if ModemManager is running - if bootloader == "caterina": - if check_modem_manager(): - rc = CheckStatus.WARNING - cli.log.warning("{fg_yellow}Detected ModemManager without the necessary udev rules. Please either disable it or set the appropriate udev rules if you are using a Pro Micro.") + if bootloader == "caterina" and check_modem_manager(): + cli.log.warning("{fg_yellow}Detected ModemManager without the necessary udev rules. Please either disable it or set the appropriate udev rules if you are using a Pro Micro.") + rc = CheckStatus.WARNING cli.log.warning("{fg_yellow}Missing or outdated udev rules for '%s' boards. Run 'sudo cp %s/util/udev/50-qmk.rules /etc/udev/rules.d/'.", bootloader, QMK_FIRMWARE) @@ -167,6 +166,5 @@ def os_test_linux(): return CheckStatus.OK else: cli.log.info("Detected {fg_cyan}Linux{fg_reset}.") - from .linux import check_udev_rules return check_udev_rules() diff --git a/lib/python/qmk/cli/doctor/main.py b/lib/python/qmk/cli/doctor/main.py index 6a31ccdfdd..ed20f46d3f 100755 --- a/lib/python/qmk/cli/doctor/main.py +++ b/lib/python/qmk/cli/doctor/main.py @@ -79,12 +79,13 @@ def doctor(cli): cli.log.info('CLI version: %s', cli.version) cli.log.info('QMK home: {fg_cyan}%s', QMK_FIRMWARE) - status = os_tests() + status = os_status = os_tests() + git_status = git_tests() - status = git_tests() + if git_status == CheckStatus.ERROR or (os_status == CheckStatus.OK and git_status == CheckStatus.WARNING): + status = git_status - venv = in_virtualenv() - if venv: + if in_virtualenv(): cli.log.info('CLI installed in virtualenv.') # Make sure the basic CLI tools we need are available and can be executed. |