Skip to content

Commit 8366607

Browse files
authored
Merge pull request #3061 from IntersectMBO/ruff_check_type_annotations
chore(lint): enforce type annotations using ruff instead of in mypy
2 parents d10bca4 + bc36ba4 commit 8366607

File tree

3 files changed

+7
-17
lines changed

3 files changed

+7
-17
lines changed

cardano_node_tests/cluster_management/resources_management.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
class BaseFilter:
88
"""Base class for resource filters."""
99

10-
def __init__(self, resources: tp.Iterable[str]):
10+
def __init__(self, resources: tp.Iterable[str]) -> None:
1111
assert not isinstance(resources, str), "`resources` can't be single string"
1212
self.resources = resources
1313

cardano_node_tests/utils/custom_clusterlib.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ def __init__(
6666
slots_offset: int | None = None,
6767
socket_path: clusterlib.FileType = "",
6868
command_era: str = consts.CommandEras.LATEST,
69-
):
69+
) -> None:
7070
super().__init__(
7171
state_dir=state_dir,
7272
slots_offset=slots_offset,

pyproject.toml

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -84,11 +84,14 @@ line-length = 100
8484
line-length = 100
8585

8686
[tool.ruff.lint]
87-
select = ["ARG", "B", "C4", "C90", "D", "DTZ", "E", "EM", "F", "FURB", "I001", "ISC", "N", "PERF", "PIE", "PL", "PLE", "PLR", "PLW", "PT", "PTH", "Q", "RET", "RSE", "RUF", "SIM", "TRY", "UP", "W", "YTT"]
88-
ignore = ["B905", "D10", "D203", "D212", "D213", "D214", "D215", "D404", "D405", "D406", "D407", "D408", "D409", "D410", "D411", "D413", "ISC001", "PLR0912", "PLR0913", "PLR0915", "PLR2004", "PT001", "PT007", "PT012", "PT018", "PT023", "PTH123", "RET504", "TRY002", "TRY301", "UP006", "UP007", "UP035"]
87+
select = ["ANN", "ARG", "B", "C4", "C90", "D", "DTZ", "E", "EM", "F", "FURB", "I001", "ISC", "N", "PERF", "PIE", "PL", "PLE", "PLR", "PLW", "PT", "PTH", "Q", "RET", "RSE", "RUF", "SIM", "TRY", "UP", "W", "YTT"]
88+
ignore = ["ANN401", "B905", "D10", "D203", "D212", "D213", "D214", "D215", "D404", "D405", "D406", "D407", "D408", "D409", "D410", "D411", "D413", "ISC001", "PLR0912", "PLR0913", "PLR0915", "PLR2004", "PT001", "PT007", "PT012", "PT018", "PT023", "PTH123", "RET504", "TRY002", "TRY301", "UP006", "UP007", "UP035"]
8989

9090
[tool.ruff.lint.per-file-ignores]
9191
"cardano_node_tests/utils/model_ekg.py" = ["N815"]
92+
"cardano_node_tests/tests/**.py" = ["ANN"]
93+
"framework_tests/**.py" = ["ANN"]
94+
"src_docs/**.py" = ["ANN"]
9295

9396
[tool.ruff.lint.isort]
9497
force-single-line = true
@@ -105,22 +108,9 @@ ignore_missing_imports = true
105108
follow_imports = "normal"
106109
no_implicit_optional = true
107110
allow_untyped_globals = false
108-
allow_untyped_defs = false
109111
warn_unused_configs = true
110112
warn_return_any = true
111113

112-
[[tool.mypy.overrides]]
113-
module = "cardano_node_tests.tests.*"
114-
allow_untyped_defs = true
115-
116-
[[tool.mypy.overrides]]
117-
module = "cardano_node_tests.*.conftest"
118-
allow_untyped_defs = false
119-
120-
[[tool.mypy.overrides]]
121-
module = "framework_tests.*"
122-
allow_untyped_defs = true
123-
124114
[tool.pytest.ini_options]
125115
log_cli = true
126116
log_level = "INFO"

0 commit comments

Comments
 (0)