From: Jérôme Benoit Date: Thu, 27 Jun 2024 20:19:25 +0000 (+0200) Subject: chore(ocpp-server): refine ruff linter configuration X-Git-Tag: v1.3.7~13^2~6 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=ad8df5d38dd7ef010f652a4e60f4af2c67e6d908;hp=118332f42f7f6fb80b895794fc5f1179f78c294c;p=e-mobility-charging-stations-simulator.git chore(ocpp-server): refine ruff linter configuration Signed-off-by: Jérôme Benoit --- diff --git a/tests/ocpp-server/pyproject.toml b/tests/ocpp-server/pyproject.toml index c01082ee..3d9c4e3b 100644 --- a/tests/ocpp-server/pyproject.toml +++ b/tests/ocpp-server/pyproject.toml @@ -20,7 +20,7 @@ format = "ruff format . && ruff check --fix ." lint = "ruff format --check --diff . && ruff check --diff ." [tool.ruff.lint] -select = ["E", "W", "F", "B", "Q", "I"] +select = ["E", "W", "F", "ASYNC", "S", "B", "A", "Q", "RUF", "I"] [build-system] diff --git a/tests/ocpp-server/server.py b/tests/ocpp-server/server.py index a7ec73c4..a5ebed38 100644 --- a/tests/ocpp-server/server.py +++ b/tests/ocpp-server/server.py @@ -170,7 +170,8 @@ async def on_connect( period: Optional[float], ): """For every new charge point that connects, create a ChargePoint instance and start - listening for messages.""" + listening for messages. + """ try: requested_protocols = websocket.request_headers["Sec-WebSocket-Protocol"] except KeyError: diff --git a/tests/ocpp-server/timer.py b/tests/ocpp-server/timer.py index b267bef6..aca74045 100644 --- a/tests/ocpp-server/timer.py +++ b/tests/ocpp-server/timer.py @@ -1,6 +1,4 @@ -""" -Timer for asyncio. -""" +"""Timer for asyncio.""" import asyncio @@ -17,7 +15,7 @@ class Timer: """An asynchronous Timer object. Parameters - ----------- + ---------- timeout: :class:`float`: The duration for which the timer should last. @@ -33,6 +31,7 @@ class Timer: callback_kwargs: Optional[:class:`dict`]: The kwargs to be passed to the callback. + """ self._timeout = timeout self._repeat = repeat @@ -61,7 +60,5 @@ class Timer: self._callback(*self._callback_args, **self._callback_kwargs) def cancel(self): - """ - Cancels the timer. The callback will not be called. - """ + """Cancels the timer. The callback will not be called.""" self._task.cancel()