From 54f4644b5c8262618cff42e4ad7ac8f6b4eef6f7 Mon Sep 17 00:00:00 2001 From: Josh Klar Date: Sun, 20 Jun 2021 13:09:47 -0700 Subject: [PATCH] fix(lint): fix all outstanding linter errors --- kmk/ble.py | 1 + kmk/led.py | 3 ++- kmk/matrix.py | 8 ++++---- kmk/rgb.py | 3 ++- setup.cfg | 7 ++++--- 5 files changed, 13 insertions(+), 9 deletions(-) diff --git a/kmk/ble.py b/kmk/ble.py index cf1be8d..fcbd19b 100644 --- a/kmk/ble.py +++ b/kmk/ble.py @@ -1,6 +1,7 @@ from adafruit_ble import BLERadio from adafruit_ble.advertising.standard import ProvideServicesAdvertisement from adafruit_ble.services.standard.hid import HIDService + from kmk.hid import AbstractHID BLE_APPEARANCE_HID_KEYBOARD = 961 diff --git a/kmk/led.py b/kmk/led.py index a0c2e15..ea7124d 100644 --- a/kmk/led.py +++ b/kmk/led.py @@ -1,7 +1,8 @@ import pulseio +from micropython import const + import time from math import e, exp, pi, sin -from micropython import const led_config = { 'brightness_step': 5, diff --git a/kmk/matrix.py b/kmk/matrix.py index c23ed9c..7f2b6e9 100644 --- a/kmk/matrix.py +++ b/kmk/matrix.py @@ -46,13 +46,13 @@ class MatrixScanner: if self.diode_orientation == DiodeOrientation.COLUMNS: self.outputs = [ x - if x.__class__.__name__ is 'DigitalInOut' + if x.__class__.__name__ == 'DigitalInOut' else digitalio.DigitalInOut(x) for x in cols ] self.inputs = [ x - if x.__class__.__name__ is 'DigitalInOut' + if x.__class__.__name__ == 'DigitalInOut' else digitalio.DigitalInOut(x) for x in rows ] @@ -60,13 +60,13 @@ class MatrixScanner: elif self.diode_orientation == DiodeOrientation.ROWS: self.outputs = [ x - if x.__class__.__name__ is 'DigitalInOut' + if x.__class__.__name__ == 'DigitalInOut' else digitalio.DigitalInOut(x) for x in rows ] self.inputs = [ x - if x.__class__.__name__ is 'DigitalInOut' + if x.__class__.__name__ == 'DigitalInOut' else digitalio.DigitalInOut(x) for x in cols ] diff --git a/kmk/rgb.py b/kmk/rgb.py index 67e62c6..9a500f6 100644 --- a/kmk/rgb.py +++ b/kmk/rgb.py @@ -1,6 +1,7 @@ +from micropython import const + import time from math import e, exp, pi, sin -from micropython import const rgb_config = { 'pixels': None, diff --git a/setup.cfg b/setup.cfg index c2c1f10..786ea94 100644 --- a/setup.cfg +++ b/setup.cfg @@ -18,9 +18,10 @@ extend-ignore = C812, C813, C815, per-file-ignores = -# Allow misaligned array entries, crazy line lengths, unused variables, and -# multiple spaces after commas in lists (for grid alignment) - user_keymaps/**/*.py: E131,F401,E501,E241,E131,BLK100 +# Allow misaligned array entries, crazy line lengths, unused variables, +# multiple spaces after commas in lists (for grid alignment), and put +# your imports in whatever order you want + user_keymaps/**/*.py: E131,F401,E501,E241,E131,BLK100,I003 tests/test_data/keymaps/**/*.py: F401,E501 # Forgive me for my RAM hack sins kmk/preload_imports.py: I001,I003,I004,F401