make type checking more strict

This commit is contained in:
Jörg Thalheim
2023-11-30 13:42:15 +01:00
parent 169355d78a
commit 01dbcec6a1
9 changed files with 49 additions and 31 deletions

View File

@@ -19,8 +19,8 @@ test_driver = ["py.typed"]
target-version = "py311"
line-length = 88
select = ["E", "F", "I", "U", "N", "RUF"]
ignore = ["E501"]
select = ["E", "F", "I", "U", "N", "RUF", "ANN"]
ignore = ["E501", "ANN101", "ANN401"]
[tool.mypy]
python_version = "3.11"

View File

@@ -36,7 +36,7 @@ def retry(fn: Callable, timeout: int = 900) -> None:
class Machine:
def __init__(self, name: str, toplevel: Path, rootdir: Path, out_dir: str):
def __init__(self, name: str, toplevel: Path, rootdir: Path, out_dir: str) -> None:
self.name = name
self.toplevel = toplevel
self.out_dir = out_dir
@@ -198,7 +198,7 @@ class Machine:
timing out.
"""
def check_active(_: Any) -> bool:
def check_active(_: bool) -> bool:
info = self.get_unit_info(unit)
state = info["ActiveState"]
if state == "failed":
@@ -247,7 +247,7 @@ def setup_filesystems() -> None:
class Driver:
def __init__(self, containers: list[Path], testscript: str, out_dir: str):
def __init__(self, containers: list[Path], testscript: str, out_dir: str) -> None:
self.containers = containers
self.testscript = testscript
self.out_dir = out_dir