Skip to content

Commit

Permalink
clean(lint)
Browse files Browse the repository at this point in the history
  • Loading branch information
florisla committed Oct 9, 2023
1 parent 43d0a00 commit 402c8ca
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 13 deletions.
1 change: 0 additions & 1 deletion .pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ max-line-length=98
disable=
fixme, # TO DOs are not errors.
consider-using-f-string, # We're not on Python >= 3.6 yet.
bad-continuation, # Be compatible to black.

[REPORT]
score=no
Expand Down
4 changes: 2 additions & 2 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
import nox


DEFAULT_PYTHON_VERSION = "3.9"
ALL_PYTHON_VERSIONS = ["3.6", "3.7", "3.8", "3.9", "3.10"]
DEFAULT_PYTHON_VERSION = "3.11"
ALL_PYTHON_VERSIONS = ["3.8", "3.9", "3.10", "3.11"]


@nox.session(python=ALL_PYTHON_VERSIONS)
Expand Down
17 changes: 11 additions & 6 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,20 @@ exclude =
build,
dist,
*.egg-info

# be compatible to black
# Missing trailing comma
# Whitespace before ':'
# line break before binary operator
ignore =
# be compatible to black
C812, # Missing trailing comma
E203, # Whitespace before ':'
W503, # line break before binary operator
C812,
E203,
W503,

# Missing docstring in public function
# .next() is not a thing in Python 3
per-file-ignores =
# Missing docstring in public function
tests/*:D103,
# .next() is not a thing in Python 3
stm32loader/bootloader.py:B305,

[tool:pytest]
Expand Down
4 changes: 2 additions & 2 deletions stm32loader/bootloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -631,11 +631,11 @@ def extended_erase_memory(self, pages=None):
:param iterable pages: Iterable of integer page addresses, zero-based.
Set to None to trigger global mass erase.
"""
if not pages and self.device_family in ('L0', ):
if not pages and self.device_family in ("L0",):
# L0 devices do not support mass erase.
# Instead, erase all pages individually.
flash_size, _uid = self.get_flash_size_and_uid()
pages = list(range(0, (flash_size*1024) // self.flash_page_size))
pages = list(range(0, (flash_size * 1024) // self.flash_page_size))

self.command(self.Command.EXTENDED_ERASE, "Extended erase memory")
if pages:
Expand Down
12 changes: 10 additions & 2 deletions stm32loader/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,12 @@ def auto_int(x):
)

address_arg = parser.add_argument(
"-a", "--address", action="store", type=auto_int, default=0x08000000, help="Target address."
"-a",
"--address",
action="store",
type=auto_int,
default=0x08000000,
help="Target address.",
)

parser.add_argument(
Expand Down Expand Up @@ -296,7 +301,10 @@ def connect(self):
show_progress = self._get_progress_bar(self.configuration.no_progress)

self.stm32 = bootloader.Stm32Bootloader(
serial_connection, verbosity=self.configuration.verbosity, show_progress=show_progress, device_family=self.configuration.family
serial_connection,
verbosity=self.configuration.verbosity,
show_progress=show_progress,
device_family=self.configuration.family,
)

try:
Expand Down

0 comments on commit 402c8ca

Please sign in to comment.