Skip to content

Commit d1cce9a

Browse files
committed
flake8: add config
This adds a flake8 config that is compatible with black. Also fix flake8 complaints outside of the bricks/ev3dev/modules/ directory. Fixes: pybricks/support#309
1 parent 797d0aa commit d1cce9a

File tree

5 files changed

+13
-6
lines changed

5 files changed

+13
-6
lines changed

.flake8

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
2+
# https://black.readthedocs.io/en/stable/compatible_configs.html#flake8
3+
4+
[flake8]
5+
max-line-length = 99
6+
extend-ignore = E203, W503
7+
exclude = .git,.venv,build,micropython,lib,manifest.py

tests/pup/hub/status_light.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
# Press the stop button to advance to the next color
55

6-
from pybricks.hubs import *
6+
from pybricks.hubs import * # noqa: F401, F403
77
from pybricks.parameters import Color
88
from pybricks.tools import wait
99

tests/pup/hub/status_light_animatinon.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Should be able to smoothly transition between all colors.
22

3-
from pybricks.hubs import *
3+
from pybricks.hubs import * # noqa: F401, F403
44
from pybricks.parameters import Color
55
from pybricks.tools import wait
66

tests/pup/motors/gears.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"""
99

1010
from pybricks.pupdevices import Motor
11-
from pybricks.parameters import Port, Stop
11+
from pybricks.parameters import Port
1212
from pybricks.tools import wait
1313

1414

tools/metadata.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,14 +71,14 @@ def generate(
7171
flash_length = None # Size of firmware area of flash memory
7272
user_start = None # Starting address of user .mpy file
7373

74-
for l in map_file.readlines():
75-
match = re.match(r"^FLASH\s+(0x[0-9A-Fa-f]{8,16})\s+(0x[0-9A-Fa-f]{8,16})", l)
74+
for line in map_file.readlines():
75+
match = re.match(r"^FLASH\s+(0x[0-9A-Fa-f]{8,16})\s+(0x[0-9A-Fa-f]{8,16})", line)
7676
if match:
7777
flash_origin = int(match[1], base=0)
7878
flash_length = int(match[2], base=0)
7979
continue
8080

81-
match = re.match(r"^\.user\s+(0x[0-9A-Fa-f]{8,16})", l)
81+
match = re.match(r"^\.user\s+(0x[0-9A-Fa-f]{8,16})", line)
8282
if match:
8383
user_start = int(match[1], base=0)
8484
continue

0 commit comments

Comments
 (0)