Skip to content

Commit 2decb54

Browse files
committed
fix(mypy): Linter fixes
1 parent 69d3456 commit 2decb54

File tree

4 files changed

+8
-20
lines changed

4 files changed

+8
-20
lines changed

ardupilot_methodic_configurator/backend_filesystem_program_settings.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ def __site_config_dir() -> str:
120120
return site_config_directory
121121

122122
@staticmethod
123-
def __get_settings_as_dict() -> dict[str, Any]: # type: ignore[misc]
123+
def __get_settings_as_dict() -> dict[str, Any]:
124124
settings_path = os_path.join(ProgramSettings.__user_config_dir(), "settings.json")
125125

126126
settings = {}
@@ -153,14 +153,14 @@ def __get_settings_as_dict() -> dict[str, Any]: # type: ignore[misc]
153153
return settings
154154

155155
@staticmethod
156-
def __set_settings_from_dict(settings: dict) -> None: # type: ignore[misc]
156+
def __set_settings_from_dict(settings: dict) -> None:
157157
settings_path = os_path.join(ProgramSettings.__user_config_dir(), "settings.json")
158158

159159
with open(settings_path, "w", encoding="utf-8") as settings_file:
160160
json_dump(settings, settings_file, indent=4)
161161

162162
@staticmethod
163-
def __get_settings_config() -> tuple[dict[str, Any], str, str]: # type: ignore[misc]
163+
def __get_settings_config() -> tuple[dict[str, Any], str, str]:
164164
settings = ProgramSettings.__get_settings_as_dict()
165165

166166
# Regular expression pattern to match single backslashes

ardupilot_methodic_configurator/backend_flightcontroller.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -525,7 +525,7 @@ def reset_and_reconnect(
525525
return self.__create_connection_with_retry(connection_progress_callback)
526526

527527
@staticmethod
528-
def __list_serial_ports() -> list[serial.tools.list_ports_common.ListPortInfo]: # type: ignore[misc]
528+
def __list_serial_ports() -> list[serial.tools.list_ports_common.ListPortInfo]:
529529
"""List all available serial ports."""
530530
comports = serial.tools.list_ports.comports()
531531
for port in comports:
@@ -555,7 +555,7 @@ def __auto_detect_serial(self) -> list[mavutil.SerialPort]:
555555
"*CubePilot*",
556556
"*Qiotek*",
557557
]
558-
serial_list = [
558+
serial_list: list[mavutil.SerialPort] = [
559559
mavutil.SerialPort(device=connection[0], description=connection[1])
560560
for connection in self.__connection_tuples
561561
if connection[1] and "mavlink" in connection[1].lower()

ardupilot_methodic_configurator/backend_mavftp.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -483,9 +483,9 @@ def __handle_list_reply(self, op, _m) -> MAVFTPReturn:
483483
logging.info(" D %s", d[1:])
484484
elif d[0] == "F":
485485
(name, size) = d[1:].split("\t")
486-
size = int(size)
487-
self.total_size += size
488-
logging.info(" %s\t%u", name, size)
486+
size_int = int(size)
487+
self.total_size += size_int
488+
logging.info(" %s\t%u", name, size_int)
489489
else:
490490
logging.info(d)
491491
# ask for more

tests/test_data_model_vehicle_components_validation_constants.py

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -47,18 +47,6 @@ def test_fc_connection_type_paths_structure(self) -> None:
4747
assert len(path) == 3
4848
assert all(isinstance(element, str) for element in path)
4949

50-
# Verify specific required paths exist
51-
expected_paths = [
52-
("RC Receiver", "FC Connection", "Type"),
53-
("Telemetry", "FC Connection", "Type"),
54-
("Battery Monitor", "FC Connection", "Type"),
55-
("ESC", "FC Connection", "Type"),
56-
("GNSS Receiver", "FC Connection", "Type"),
57-
]
58-
59-
for expected_path in expected_paths:
60-
assert expected_path in FC_CONNECTION_TYPE_PATHS
61-
6250
# All paths should follow the pattern (Component, "FC Connection", "Type")
6351
for path in FC_CONNECTION_TYPE_PATHS:
6452
assert path[1] == "FC Connection"

0 commit comments

Comments
 (0)