Fix linting; move kmk.util.intify_coordinate to kmk.matrix.intify_coordinate (trying to deprecate/remove util)
This commit is contained in:
parent
4bdf926360
commit
ef1c69aa2c
1
Makefile
1
Makefile
@ -90,7 +90,6 @@ docker-base-deploy: docker-base
|
||||
devdeps: .devdeps
|
||||
|
||||
lint: devdeps
|
||||
@$(PIPENV) run black --check
|
||||
@$(PIPENV) run flake8
|
||||
|
||||
fix-formatting: devdeps
|
||||
|
1
Pipfile
1
Pipfile
@ -20,6 +20,7 @@ neovim = "*"
|
||||
s3cmd = "*"
|
||||
black = "==19.3b0"
|
||||
flake8-quotes = "*"
|
||||
flake8-black = "*"
|
||||
|
||||
[requires]
|
||||
python_version = "3.7"
|
||||
|
9
Pipfile.lock
generated
9
Pipfile.lock
generated
@ -1,7 +1,7 @@
|
||||
{
|
||||
"_meta": {
|
||||
"hash": {
|
||||
"sha256": "019b67ce05e7e68766ba54ddbfd3e2faf5dd81c7ded79f80ff3ef85b0017c99d"
|
||||
"sha256": "e2a8058d3c40039167ababbfee7347b3b61cb679c65b7f98c2b56ba91fafa0dd"
|
||||
},
|
||||
"pipfile-spec": 6,
|
||||
"requires": {
|
||||
@ -76,6 +76,13 @@
|
||||
"index": "pypi",
|
||||
"version": "==3.6.0"
|
||||
},
|
||||
"flake8-black": {
|
||||
"hashes": [
|
||||
"sha256:6b5fe2a609fa750170da8d5b1ed7c11029bceaff025660be7f19307ec6fa0c35"
|
||||
],
|
||||
"index": "pypi",
|
||||
"version": "==0.1.0"
|
||||
},
|
||||
"flake8-commas": {
|
||||
"hashes": [
|
||||
"sha256:d3005899466f51380387df7151fb59afec666a0f4f4a2c6a8995b975de0f44b7",
|
||||
|
@ -1,9 +1,9 @@
|
||||
import board
|
||||
|
||||
from kmk.consts import DiodeOrientation
|
||||
from kmk.matrix import intify_coordinate as ic
|
||||
from kmk.mcus.circuitpython_usbhid import KeyboardConfig as _KeyboardConfig
|
||||
from kmk.pins import Pin as P
|
||||
from kmk.util import intify_coordinate as ic
|
||||
|
||||
|
||||
class KeyboardConfig(_KeyboardConfig):
|
||||
|
@ -1,7 +1,7 @@
|
||||
from kmk.consts import DiodeOrientation
|
||||
from kmk.matrix import intify_coordinate as ic
|
||||
from kmk.mcus.circuitpython_usbhid import KeyboardConfig as _KeyboardConfig
|
||||
from kmk.pins import Pin as P
|
||||
from kmk.util import intify_coordinate as ic
|
||||
|
||||
# Implements what used to be handled by KeyboardConfig.swap_indicies for this
|
||||
# board, by flipping various row3 (bottom physical row) keys so their
|
||||
|
@ -1,8 +1,8 @@
|
||||
from kmk.consts import LeaderMode
|
||||
from kmk.keys import KC
|
||||
from kmk.kmktime import ticks_ms
|
||||
from kmk.matrix import intify_coordinate
|
||||
from kmk.types import TapDanceKeyMeta
|
||||
from kmk.util import intify_coordinate
|
||||
|
||||
|
||||
class InternalState:
|
||||
|
@ -49,7 +49,8 @@ import kmk.internal_state # isort:skip
|
||||
# Thanks for sticking around. Now let's do real work, starting below
|
||||
|
||||
from kmk.kmktime import sleep_ms
|
||||
from kmk.util import intify_coordinate as ic
|
||||
from kmk.matrix import intify_coordinate as ic
|
||||
|
||||
from kmk import led, rgb # isort:skip
|
||||
|
||||
|
||||
|
@ -3,6 +3,10 @@ import digitalio
|
||||
from kmk.consts import DiodeOrientation
|
||||
|
||||
|
||||
def intify_coordinate(row, col):
|
||||
return row << 8 | col
|
||||
|
||||
|
||||
class MatrixScanner:
|
||||
def __init__(
|
||||
self,
|
||||
|
@ -1,7 +1,3 @@
|
||||
def intify_coordinate(row, col):
|
||||
return row << 8 | col
|
||||
|
||||
|
||||
def get_wide_ordinal(char):
|
||||
if len(char) != 2:
|
||||
return ord(char)
|
||||
|
14
setup.cfg
14
setup.cfg
@ -4,14 +4,22 @@ exclude = .git,__pycache__,vendor,.venv,build
|
||||
max_line_length = 88
|
||||
|
||||
# enforce single quotes
|
||||
select = Q0
|
||||
docstring-quotes = '''
|
||||
multiline-quotes = '''
|
||||
|
||||
ignore = X100, E262
|
||||
extend-ignore =
|
||||
X100, E262,
|
||||
# See https://github.com/PyCQA/pycodestyle/issues/373
|
||||
E203,
|
||||
# comply with black
|
||||
# it will handle line lengths automatically
|
||||
E501,
|
||||
# it also controls trailing commas in general
|
||||
C812, C813, C815,
|
||||
|
||||
per-file-ignores =
|
||||
# Allow crazy line lengths, unused variables, and multiple spaces after commas in lists (for grid alignment)
|
||||
user_keymaps/**/*.py: F401,E501,E241,E131
|
||||
user_keymaps/**/*.py: F401,E501,E241,E131,BLK100
|
||||
tests/test_data/keymaps/**/*.py: F401,E501
|
||||
# Forgive me for my RAM hack sins
|
||||
kmk/keyboard_config.py: I001,I003,I004,F401
|
||||
|
@ -1,6 +1,5 @@
|
||||
from kmk.consts import DiodeOrientation, UnicodeMode
|
||||
from kmk.handlers.sequences import (compile_unicode_string_sequences,
|
||||
send_string)
|
||||
from kmk.handlers.sequences import compile_unicode_string_sequences, send_string
|
||||
from kmk.keys import KC
|
||||
from kmk.mcus.circuitpython_usbhid import KeyboardConfig
|
||||
from kmk.pins import Pin as P
|
||||
|
@ -1,6 +1,5 @@
|
||||
from kmk.consts import DiodeOrientation, UnicodeMode
|
||||
from kmk.handlers.sequences import (compile_unicode_string_sequences,
|
||||
send_string)
|
||||
from kmk.handlers.sequences import compile_unicode_string_sequences, send_string
|
||||
from kmk.keys import KC
|
||||
from kmk.mcus.circuitpython_usbhid import KeyboardConfig
|
||||
from kmk.pins import Pin as P
|
||||
|
Loading…
Reference in New Issue
Block a user