Skip to content

Commit 31b57a6

Browse files
authored
Update linters (#2038)
1 parent e6a429d commit 31b57a6

13 files changed

Lines changed: 19 additions & 15 deletions

File tree

can/interfaces/robotell.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ def __init__(
7474
if not channel: # if None or empty
7575
raise TypeError("Must specify a serial port.")
7676
if "@" in channel:
77-
(channel, ttyBaudrate) = channel.split("@")
77+
channel, ttyBaudrate = channel.split("@")
7878
self.serialPortOrig = serial.serial_for_url(
7979
channel, baudrate=ttyBaudrate, rtscts=rtscts
8080
)

can/interfaces/slcan.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ def __init__(
132132
if not channel: # if None or empty
133133
raise ValueError("Must specify a serial port.")
134134
if "@" in channel:
135-
(channel, baudrate) = channel.split("@")
135+
channel, baudrate = channel.split("@")
136136
tty_baudrate = int(baudrate)
137137

138138
with error_check(exception_type=CanInitializationError):

can/interfaces/systec/structures.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ def __eq__(self, other):
7474
def id(self):
7575
return self.m_dwID
7676

77-
@id.setter
77+
@id.setter # noqa: A003
7878
def id(self, value):
7979
self.m_dwID = value
8080

can/interfaces/udp_multicast/bus.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,7 @@ def recv(
397397
timestamp = seconds + nanoseconds * 1.0e-9
398398
else:
399399
# fetch data & source address
400-
(raw_message_data, sender_address) = self._socket.recvfrom(
400+
raw_message_data, sender_address = self._socket.recvfrom(
401401
self.max_buffer
402402
)
403403

can/io/sqlite.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -178,8 +178,7 @@ def _create_db(file: StringPathLike, table_name: str) -> sqlite3.Connection:
178178
conn = sqlite3.connect(file)
179179

180180
# create table structure
181-
conn.cursor().execute(
182-
f"""CREATE TABLE IF NOT EXISTS {table_name}
181+
conn.cursor().execute(f"""CREATE TABLE IF NOT EXISTS {table_name}
183182
(
184183
ts REAL,
185184
arbitration_id INTEGER,
@@ -188,8 +187,7 @@ def _create_db(file: StringPathLike, table_name: str) -> sqlite3.Connection:
188187
error INTEGER,
189188
dlc INTEGER,
190189
data BLOB
191-
)"""
192-
)
190+
)""")
193191
conn.commit()
194192

195193
return conn

can/util.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -177,9 +177,7 @@ def load_config(
177177
[
178178
given_config,
179179
can.rc,
180-
lambda _context: load_environment_config( # pylint: disable=unnecessary-lambda
181-
_context
182-
),
180+
load_environment_config,
183181
lambda _context: load_environment_config(),
184182
lambda _context: load_file_config(path, _context),
185183
lambda _context: load_file_config(path),

pyproject.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,15 +90,15 @@ docs = [
9090
]
9191
lint = [
9292
"pylint==4.0.*",
93-
"ruff==0.14.*",
94-
"black==25.12.*",
93+
"ruff==0.15.*",
94+
"black==26.1.*",
9595
"mypy==1.19.*",
9696
]
9797
test = [
9898
"pytest==9.0.*",
9999
"pytest-timeout==2.4.*",
100100
"pytest-modern==0.7.*;platform_system!='Windows'",
101-
"coveralls==4.0.*",
101+
"coveralls==4.1.*",
102102
"pytest-cov==7.0.*",
103103
"coverage==7.13.*",
104104
"hypothesis==6.*",

test/listener_test.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#!/usr/bin/env python
22

33
""" """
4+
45
import asyncio
56
import logging
67
import os

test/test_cyclic_socketcan.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"""
44
This module tests multiple message cyclic send tasks.
55
"""
6+
67
import time
78
import unittest
89

test/test_neovi.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#!/usr/bin/env python
22

33
""" """
4+
45
import pickle
56
import unittest
67

0 commit comments

Comments
 (0)