Skip to content

Commit

Permalink
flake8: add config
Browse files Browse the repository at this point in the history
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
  • Loading branch information
dlech committed Apr 22, 2021
1 parent 797d0aa commit d1cce9a
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 6 deletions.
7 changes: 7 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@

# https://black.readthedocs.io/en/stable/compatible_configs.html#flake8

[flake8]
max-line-length = 99
extend-ignore = E203, W503
exclude = .git,.venv,build,micropython,lib,manifest.py
2 changes: 1 addition & 1 deletion tests/pup/hub/status_light.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

# Press the stop button to advance to the next color

from pybricks.hubs import *
from pybricks.hubs import * # noqa: F401, F403
from pybricks.parameters import Color
from pybricks.tools import wait

Expand Down
2 changes: 1 addition & 1 deletion tests/pup/hub/status_light_animatinon.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Should be able to smoothly transition between all colors.

from pybricks.hubs import *
from pybricks.hubs import * # noqa: F401, F403
from pybricks.parameters import Color
from pybricks.tools import wait

Expand Down
2 changes: 1 addition & 1 deletion tests/pup/motors/gears.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"""

from pybricks.pupdevices import Motor
from pybricks.parameters import Port, Stop
from pybricks.parameters import Port
from pybricks.tools import wait


Expand Down
6 changes: 3 additions & 3 deletions tools/metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,14 +71,14 @@ def generate(
flash_length = None # Size of firmware area of flash memory
user_start = None # Starting address of user .mpy file

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

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

0 comments on commit d1cce9a

Please sign in to comment.